summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);