aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavide Caratti <dcaratti@redhat.com>2018-02-15 15:50:57 +0100
committerDavid S. Miller <davem@davemloft.net>2018-02-16 15:43:17 -0500
commit66dede2d6b2340235ca212532275446d7bb010fe (patch)
tree63f71ac24b38a93233eec17193fd7f0e63419e20
parentMerge branch 'dsa-mv88e6xxx-Improve-PTP-access-latency' (diff)
downloadlinux-dev-66dede2d6b2340235ca212532275446d7bb010fe.tar.xz
linux-dev-66dede2d6b2340235ca212532275446d7bb010fe.zip
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>
-rw-r--r--net/sched/act_api.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/sched/act_api.c b/net/sched/act_api.c
index 4886ea4a7d6e..624995564e5a 100644
--- a/net/sched/act_api.c
+++ b/net/sched/act_api.c
@@ -938,8 +938,10 @@ static int tca_action_flush(struct net *net, struct nlattr *nla,
goto out_module_put;
err = ops->walk(net, skb, &dcb, RTM_DELACTION, ops);
- if (err <= 0)
+ if (err <= 0) {
+ nla_nest_cancel(skb, nest);
goto out_module_put;
+ }
nla_nest_end(skb, nest);