]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
text ematch: check for NULL pointer before destroying textsearch config
authorThomas Graf <tgraf@infradead.org>
Sun, 31 Oct 2010 16:37:38 +0000 (09:37 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sun, 31 Oct 2010 16:37:38 +0000 (09:37 -0700)
While validating the configuration em_ops is already set, thus the
individual destroy functions are called, but the ematch data has
not been allocated and associated with the ematch yet.

Signed-off-by: Thomas Graf <tgraf@infradead.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/em_text.c

index 763253257411af1db91b3e25a78af8e687523342..ea8f566e720c7bd9ed508647c080c5c554edba2b 100644 (file)
@@ -103,7 +103,8 @@ retry:
 
 static void em_text_destroy(struct tcf_proto *tp, struct tcf_ematch *m)
 {
 
 static void em_text_destroy(struct tcf_proto *tp, struct tcf_ematch *m)
 {
-       textsearch_destroy(EM_TEXT_PRIV(m)->config);
+       if (EM_TEXT_PRIV(m) && EM_TEXT_PRIV(m)->config)
+               textsearch_destroy(EM_TEXT_PRIV(m)->config);
 }
 
 static int em_text_dump(struct sk_buff *skb, struct tcf_ematch *m)
 }
 
 static int em_text_dump(struct sk_buff *skb, struct tcf_ematch *m)