netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] text ematch: check for NULL pointer before destroying textsearch config
@ 2010-10-31  8:06 Thomas Graf
  2010-10-31 16:38 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Graf @ 2010-10-31  8:06 UTC (permalink / raw)
  To: davem; +Cc: netdev

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>

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)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-10-31 16:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-31  8:06 [PATCH] text ematch: check for NULL pointer before destroying textsearch config Thomas Graf
2010-10-31 16:38 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).