net_sched: fix two more memory leaks in cls_tcindex
authorCong Wang <xiyou.wangcong@gmail.com>
Mon, 11 Feb 2019 21:06:16 +0000 (13:06 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 12 Feb 2019 19:10:56 +0000 (14:10 -0500)
commit1db817e75f5b9387b8db11e37d5f0624eb9223e0
tree90cf99c0f5c73ebd5c9927fa10df065495647053
parent033b228e7f26b29ae37f8bfa1bc6b209a5365e9f
net_sched: fix two more memory leaks in cls_tcindex

struct tcindex_filter_result contains two parts:
struct tcf_exts and struct tcf_result.

For the local variable 'cr', its exts part is never used but
initialized without being released properly on success path. So
just completely remove the exts part to fix this leak.

For the local variable 'new_filter_result', it is never properly
released if not used by 'r' on success path.

Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/cls_tcindex.c