Skip to content

Commit

Permalink
net: sched: cls_matchall: cleanup flow_action before deallocating
Browse files Browse the repository at this point in the history
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: 5a6ff4b ("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>
  • Loading branch information
Vlad Buslov authored and David S. Miller committed Aug 30, 2019
1 parent de8e1be commit f2b795e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/sched/cls_matchall.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ static int mall_replace_hw_filter(struct tcf_proto *tp,

err = tc_setup_cb_add(block, tp, TC_SETUP_CLSMATCHALL, &cls_mall,
skip_sw, &head->flags, &head->in_hw_count, true);
tc_cleanup_flow_action(&cls_mall.rule->action);
kfree(cls_mall.rule);

if (err) {
Expand Down Expand Up @@ -313,6 +314,7 @@ static int mall_reoffload(struct tcf_proto *tp, bool add, flow_setup_cb_t *cb,
err = tc_setup_cb_reoffload(block, tp, add, cb, TC_SETUP_CLSMATCHALL,
&cls_mall, cb_priv, &head->flags,
&head->in_hw_count);
tc_cleanup_flow_action(&cls_mall.rule->action);
kfree(cls_mall.rule);

if (err)
Expand Down

0 comments on commit f2b795e

Please sign in to comment.