Commit 8fcb0382 authored by Hangyu Hua's avatar Hangyu Hua Committed by David S. Miller
Browse files

net: sched: em_text: fix possible memory leak in em_text_destroy()



m->data needs to be freed when em_text_destroy is called.

Fixes: d675c989 ("[PKT_SCHED]: Packet classification based on textsearch (ematch)")
Acked-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: default avatarHangyu Hua <hbh25y@gmail.com>
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent dcea1bd4
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -97,8 +97,10 @@ static int em_text_change(struct net *net, void *data, int len,

static void em_text_destroy(struct tcf_ematch *m)
{
	if (EM_TEXT_PRIV(m) && EM_TEXT_PRIV(m)->config)
	if (EM_TEXT_PRIV(m) && EM_TEXT_PRIV(m)->config) {
		textsearch_destroy(EM_TEXT_PRIV(m)->config);
		kfree(EM_TEXT_PRIV(m));
	}
}

static int em_text_dump(struct sk_buff *skb, struct tcf_ematch *m)