summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorCong Wang <xiyou.wangcong@gmail.com>2019-02-16 10:58:27 -0800
committerDavid S. Miller <davem@davemloft.net>2019-02-20 20:11:10 -0800
commit51dcb69de67a5141a4f39b03402b2c5160e91040 (patch)
tree75927f0a5585b3610cd09d91c211fb85a5701b7b /include
parent3d210534cc93dab39a9d1a8d674aa2872c268d38 (diff)
downloadlinux-51dcb69de67a5141a4f39b03402b2c5160e91040.tar.bz2
net_sched: fix a memory leak in cls_tcindex
(cherry picked from commit 033b228e7f26b29ae37f8bfa1bc6b209a5365e9f) When tcindex_destroy() destroys all the filter results in the perfect hash table, it invokes the walker to delete each of them. However, results with class==0 are skipped in either tcindex_walk() or tcindex_delete(), which causes a memory leak reported by kmemleak. This patch fixes it by skipping the walker and directly deleting these filter results so we don't miss any filter result. As a result of this change, we have to initialize exts->net properly in tcindex_alloc_perfect_hash(). For net-next, we need to consider whether we should initialize ->net in tcf_exts_init() instead, before that just directly test CONFIG_NET_CLS_ACT=y. 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>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions