Commit 5ec1cea057495b8f10bab0c1396a9d8e46b7b0a8
Committed by
David S. Miller
1 parent
636f8c6f68
Exists in
master
and in
39 other branches
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. Signed-off-by: Thomas Graf <tgraf@infradead.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Showing 1 changed file with 2 additions and 1 deletions Side-by-side Diff
net/sched/em_text.c
... | ... | @@ -103,7 +103,8 @@ |
103 | 103 | |
104 | 104 | static void em_text_destroy(struct tcf_proto *tp, struct tcf_ematch *m) |
105 | 105 | { |
106 | - textsearch_destroy(EM_TEXT_PRIV(m)->config); | |
106 | + if (EM_TEXT_PRIV(m) && EM_TEXT_PRIV(m)->config) | |
107 | + textsearch_destroy(EM_TEXT_PRIV(m)->config); | |
107 | 108 | } |
108 | 109 | |
109 | 110 | static int em_text_dump(struct sk_buff *skb, struct tcf_ematch *m) |