summaryrefslogtreecommitdiff
path: root/net/sched
diff options
context:
space:
mode:
authorYang Yingliang <yangyingliang@huawei.com>2021-06-17 16:02:07 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-07-19 08:53:11 +0200
commit995c3fc302bd922b93fb205fb830875ddb955a18 (patch)
treef594973bf00b160b7f8877a8f745571224607b3e /net/sched
parentbba660a079a9e7ff3809a688d5c9fdf5a377c6bf (diff)
net: sched: fix error return code in tcf_del_walker()
[ Upstream commit 55d96f72e8ddc0a294e0b9c94016edbb699537e1 ] When nla_put_u32() fails, 'ret' could be 0, it should return error code in tcf_del_walker(). Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net/sched')
-rw-r--r--net/sched/act_api.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/sched/act_api.c b/net/sched/act_api.c
index 716cad677318..17e5cd9ebd89 100644
--- a/net/sched/act_api.c
+++ b/net/sched/act_api.c
@@ -316,7 +316,8 @@ static int tcf_del_walker(struct tcf_idrinfo *idrinfo, struct sk_buff *skb,
}
mutex_unlock(&idrinfo->lock);
- if (nla_put_u32(skb, TCA_FCNT, n_i))
+ ret = nla_put_u32(skb, TCA_FCNT, n_i);
+ if (ret)
goto nla_put_failure;
nla_nest_end(skb, nest);