Skip to content

Commit

Permalink
text ematch: check for NULL pointer before destroying textsearch config
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Thomas Graf authored and David S. Miller committed Oct 31, 2010
1 parent 636f8c6 commit 5ec1cea
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/sched/em_text.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ static int em_text_change(struct tcf_proto *tp, void *data, int len,

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)
Expand Down

0 comments on commit 5ec1cea

Please sign in to comment.