Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: sched: cls_matchall: cleanup flow_action before deallocating

Recent rtnl lock removal patch changed flow_action infra to require proper
cleanup besides simple memory deallocation. However, matchall classifier
was not updated to call tc_cleanup_flow_action(). Add proper cleanup to
mall_replace_hw_filter() and mall_reoffload().

Fixes: 5a6ff4b13d59 ("net: sched: take reference to action dev before calling offloads")
Reported-by: Ido Schimmel <idosch@mellanox.com>
Tested-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Vlad Buslov <vladbu@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Vlad Buslov and committed by
David S. Miller
f2b795ea de8e1beb

+2
+2
net/sched/cls_matchall.c
··· 111 111 112 112 err = tc_setup_cb_add(block, tp, TC_SETUP_CLSMATCHALL, &cls_mall, 113 113 skip_sw, &head->flags, &head->in_hw_count, true); 114 + tc_cleanup_flow_action(&cls_mall.rule->action); 114 115 kfree(cls_mall.rule); 115 116 116 117 if (err) { ··· 314 313 err = tc_setup_cb_reoffload(block, tp, add, cb, TC_SETUP_CLSMATCHALL, 315 314 &cls_mall, cb_priv, &head->flags, 316 315 &head->in_hw_count); 316 + tc_cleanup_flow_action(&cls_mall.rule->action); 317 317 kfree(cls_mall.rule); 318 318 319 319 if (err)