* [PATCH net-next] ieee802154: fix error return code in ieee802154_llsec_getparams()
@ 2021-05-19 14:16 Wei Yongjun
2021-05-20 5:44 ` Dan Carpenter
2021-06-03 9:01 ` Stefan Schmidt
0 siblings, 2 replies; 3+ messages in thread
From: Wei Yongjun @ 2021-05-19 14:16 UTC (permalink / raw)
To: weiyongjun1, Alexander Aring, Stefan Schmidt, David S. Miller,
Jakub Kicinski
Cc: linux-wpan, netdev, kernel-janitors, Hulk Robot
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@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.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);
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] ieee802154: fix error return code in ieee802154_llsec_getparams()
2021-05-19 14:16 [PATCH net-next] ieee802154: fix error return code in ieee802154_llsec_getparams() Wei Yongjun
@ 2021-05-20 5:44 ` Dan Carpenter
2021-06-03 9:01 ` Stefan Schmidt
1 sibling, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2021-05-20 5:44 UTC (permalink / raw)
To: Wei Yongjun
Cc: Alexander Aring, Stefan Schmidt, David S. Miller, Jakub Kicinski,
linux-wpan, netdev, kernel-janitors, Hulk Robot,
Phoebe Buckheister
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 <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] ieee802154: fix error return code in ieee802154_llsec_getparams()
2021-05-19 14:16 [PATCH net-next] ieee802154: fix error return code in ieee802154_llsec_getparams() Wei Yongjun
2021-05-20 5:44 ` Dan Carpenter
@ 2021-06-03 9:01 ` Stefan Schmidt
1 sibling, 0 replies; 3+ messages in thread
From: Stefan Schmidt @ 2021-06-03 9:01 UTC (permalink / raw)
To: Wei Yongjun, Alexander Aring, David S. Miller, Jakub Kicinski
Cc: linux-wpan, netdev, kernel-janitors, Hulk Robot
Hello.
On 19.05.21 16:16, 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 <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.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);
This patch has been applied to the wpan tree and will be
part of the next pull request to net. Thanks!
regards
Stefan Schmidt
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-06-03 9:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-19 14:16 [PATCH net-next] ieee802154: fix error return code in ieee802154_llsec_getparams() Wei Yongjun
2021-05-20 5:44 ` Dan Carpenter
2021-06-03 9:01 ` Stefan Schmidt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).