[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210519141614.3040055-1-weiyongjun1@huawei.com>
Date: Wed, 19 May 2021 14:16:14 +0000
From: Wei Yongjun <weiyongjun1@...wei.com>
To: <weiyongjun1@...wei.com>, Alexander Aring <alex.aring@...il.com>,
"Stefan Schmidt" <stefan@...enfreihafen.org>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>
CC: <linux-wpan@...r.kernel.org>, <netdev@...r.kernel.org>,
<kernel-janitors@...r.kernel.org>, Hulk Robot <hulkci@...wei.com>
Subject: [PATCH net-next] ieee802154: fix error return code in ieee802154_llsec_getparams()
Fix to return negative error code -ENOBUFS from the error handling
case instead of 0, as done elsewhere in this function.
Reported-by: Hulk Robot <hulkci@...wei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@...wei.com>
---
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 0c1b0770c59e..c23c152860b7 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, ¶ms.out_key))
+ ieee802154_llsec_fill_key_id(msg, ¶ms.out_key)) {
+ rc = -ENOBUFS;
goto out_free;
+ }
dev_put(dev);
Powered by blists - more mailing lists