All of lore.kernel.org
 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

* Re: [PATCH] text ematch: check for NULL pointer before destroying textsearch config
  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
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2010-10-31 16:38 UTC (permalink / raw)
  To: tgraf; +Cc: netdev

From: Thomas Graf <tgraf@infradead.org>
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 <tgraf@infradead.org>

Applied, thanks Thomas.

^ 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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.