net: sched: fix error return code in tcf_del_walker()
Subsystems (3)
PATCH 1/1 net: sched: fix error return code in tcf_del_walker()
When nla_put_u32() fails, 'ret' could be 0, it should return error code in tcf_del_walker().
Reported-by Hulk Robot <[email protected]>
Signed-off-by Yang Yingliang <[email protected]>
--- net/sched/act_api.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/sched/act_api.c +2 -1
@@ -381,7 +381,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);
Signature · 1 line
2.25.1
This patch was applied to netdev/net-next.git (refs/heads/master):
Hello:
This patch was applied to netdev/net-next.git (refs/heads/master):
Quoted 8 lines · On Thu, 17 Jun 2021 16:02:07 +0800 you wrote:
When
nla_put_u32()fails, 'ret' could be 0, it should return error code intcf_del_walker().Reported-by Hulk Robot <[email protected]>Signed-off-by Yang Yingliang <[email protected]>--- net/sched/act_api.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Here is the summary with links:
- [net-next] net: sched: fix error return code in tcf_del_walker()
https://git.kernel.org/netdev/net-next/c/55d96f72e8dd
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html