Skip to contentSkip to conversation

net: sched: fix error return code in tcf_del_walker()

PATCH Applied Yang Yingliang 2 participants 2 messages Jun 17, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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().

---
 net/sched/act_api.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
net/sched/act_api.c +2 -1
index f6d5755d669e..d17a66aab8ee 100644
@@ -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
#1 lore raw
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 in tcf_del_walker().

---
 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