[PATCH] text ematch: check for NULL pointer before destroying textsearch config

STALE5768d

2 messages, 2 authors, 2010-10-31 · open the first message on its own page

[PATCH] text ematch: check for NULL pointer before destroying textsearch config

From: Thomas Graf <hidden>
Date: 2010-10-31 08:06:36

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 <redacted>

Index: net-2.6/net/sched/em_text.c
===================================================================
--- net-2.6.orig/net/sched/em_text.c
+++ net-2.6/net/sched/em_text.c
@@ -103,7 +103,8 @@ retry:
 
 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)

Re: [PATCH] text ematch: check for NULL pointer before destroying textsearch config

From: David Miller <davem@davemloft.net>
Date: 2010-10-31 16:37:36

From: Thomas Graf <redacted>
Date: Sun, 31 Oct 2010 04:06:35 -0400
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 <redacted>
Applied, thanks Thomas.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help