lkml.org 
[lkml]   [2021]   [Jul]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.12 100/242] net: sched: fix error return code in tcf_del_walker()
    Date
    From: Yang Yingliang <yangyingliang@huawei.com>

    [ 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>
    ---
    net/sched/act_api.c | 3 ++-
    1 file changed, 2 insertions(+), 1 deletion(-)

    diff --git a/net/sched/act_api.c b/net/sched/act_api.c
    index f6d5755d669e..d17a66aab8ee 100644
    --- a/net/sched/act_api.c
    +++ b/net/sched/act_api.c
    @@ -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);

    --
    2.30.2


    \
     
     \ /
      Last update: 2021-07-15 21:10    [W:4.031 / U:0.736 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site