Skip to contentSkip to conversation

text ematch: check for NULL pointer before destroying textsearch config

PATCH Applied Thomas Graf 2 participants 2 messages Oct 31, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 text ematch: check for NULL pointer before destroying textsearch config

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.

net/sched/em_text.c +2 -1
Index: 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)
maintainer Applied
#1 lore raw

From: Thomas Graf <[email protected]>
Date: Sun, 31 Oct 2010 04:06:35 -0400

Quoted 5 lines

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.

Applied, thanks Thomas.