lkml.org 
[lkml]   [2021]   [Jun]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.10 040/137] ieee802154: fix error return code in ieee802154_llsec_getparams()
    Date
    From: Wei Yongjun <weiyongjun1@huawei.com>

    [ Upstream commit 373e864cf52403b0974c2f23ca8faf9104234555 ]

    Fix to return negative error code -ENOBUFS from the error handling
    case instead of 0, as done elsewhere in this function.

    Fixes: 3e9c156e2c21 ("ieee802154: add netlink interfaces for llsec")
    Reported-by: Hulk Robot <hulkci@huawei.com>
    Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
    Link: https://lore.kernel.org/r/20210519141614.3040055-1-weiyongjun1@huawei.com
    Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    net/ieee802154/nl-mac.c | 4 +++-
    1 file changed, 3 insertions(+), 1 deletion(-)

    diff --git a/net/ieee802154/nl-mac.c b/net/ieee802154/nl-mac.c
    index d19c40c684e8..71be75112321 100644
    --- a/net/ieee802154/nl-mac.c
    +++ b/net/ieee802154/nl-mac.c
    @@ -680,8 +680,10 @@ int ieee802154_llsec_getparams(struct sk_buff *skb, struct genl_info *info)
    nla_put_u8(msg, IEEE802154_ATTR_LLSEC_SECLEVEL, params.out_level) ||
    nla_put_u32(msg, IEEE802154_ATTR_LLSEC_FRAME_COUNTER,
    be32_to_cpu(params.frame_counter)) ||
    - ieee802154_llsec_fill_key_id(msg, &params.out_key))
    + ieee802154_llsec_fill_key_id(msg, &params.out_key)) {
    + rc = -ENOBUFS;
    goto out_free;
    + }

    dev_put(dev);

    --
    2.30.2


    \
     
     \ /
      Last update: 2021-06-08 21:02    [W:4.159 / U:0.316 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site