[PATCH net-next] ieee802154: fix error return code in ieee802154_llsec_getparams()

Subsystems: ieee 802.15.4 subsystem, networking [general], the rest

STALE1921d LANDED

Landed in mainline as 373e864cf524 on 2021-06-03.

3 messages, 3 authors, 2021-06-03 · open the first message on its own page

[PATCH net-next] ieee802154: fix error return code in ieee802154_llsec_getparams()

From: Wei Yongjun <hidden>
Date: 2021-05-19 14:07:10

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 <redacted>
Signed-off-by: Wei Yongjun <redacted>
---
 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, &params.out_key))
+	    ieee802154_llsec_fill_key_id(msg, &params.out_key)) {
+		rc = -ENOBUFS;
 		goto out_free;
+	}
 
 	dev_put(dev);
 

Re: [PATCH net-next] ieee802154: fix error return code in ieee802154_llsec_getparams()

From: Dan Carpenter <hidden>
Date: 2021-05-20 05:45:17

On Wed, May 19, 2021 at 02:16:14PM +0000, Wei Yongjun wrote:
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 <redacted>
Signed-off-by: Wei Yongjun <redacted>
Fixes: 3e9c156e2c21 ("ieee802154: add netlink interfaces for llsec")

This patch doesn't seem to affect runtime so far as I can tell with
a quick glance...

regards,
dan carpenter

Re: [PATCH net-next] ieee802154: fix error return code in ieee802154_llsec_getparams()

From: Stefan Schmidt <stefan@datenfreihafen.org>
Date: 2021-06-03 09:01:55

Hello.

On 19.05.21 16:16, Wei Yongjun wrote:
quoted hunk
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 <redacted>
Signed-off-by: Wei Yongjun <redacted>
---
  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, &params.out_key))
+	    ieee802154_llsec_fill_key_id(msg, &params.out_key)) {
+		rc = -ENOBUFS;
  		goto out_free;
+	}
  
  	dev_put(dev);

This patch has been applied to the wpan tree and will be
part of the next pull request to net. Thanks!

regards
Stefan Schmidt
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help