Skip to content

Commit

Permalink
net: sched: fix error return code in tcf_del_walker()
Browse files Browse the repository at this point in the history
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]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Yang Yingliang authored and davem330 committed Jun 17, 2021
1 parent b244163 commit 55d96f7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/sched/act_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 55d96f7

Please sign in to comment.