Skip to content

Commit 66dede2

Browse files
dcarattidavem330
authored andcommitted
net: sched: fix unbalance in the error path of tca_action_flush()
When tca_action_flush() calls the action walk() and gets an error, a successful call to nla_nest_start() is not followed by a call to nla_nest_cancel(). It's harmless, as the skb is freed in the error path - but it's worth to fix this unbalance. Signed-off-by: Davide Caratti <dcaratti@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent e5fe068 commit 66dede2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

net/sched/act_api.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -938,8 +938,10 @@ static int tca_action_flush(struct net *net, struct nlattr *nla,
938938
goto out_module_put;
939939

940940
err = ops->walk(net, skb, &dcb, RTM_DELACTION, ops);
941-
if (err <= 0)
941+
if (err <= 0) {
942+
nla_nest_cancel(skb, nest);
942943
goto out_module_put;
944+
}
943945

944946
nla_nest_end(skb, nest);
945947

0 commit comments

Comments
 (0)