From: Thomas Graf Date: Sun, 31 Oct 2010 16:37:38 +0000 (-0700) Subject: text ematch: check for NULL pointer before destroying textsearch config X-Git-Tag: firefly_0821_release~7613^2~3442^2~80 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=5ec1cea057495b8f10bab0c1396a9d8e46b7b0a8;p=firefly-linux-kernel-4.4.55.git 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 Signed-off-by: David S. Miller --- diff --git a/net/sched/em_text.c b/net/sched/em_text.c index 763253257411..ea8f566e720c 100644 --- a/net/sched/em_text.c +++ b/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)