projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
68fe1db
)
net: ieee802154: fix error return code in dgram_bind()
author
Wei Yongjun
<weiyongjun1@huawei.com>
Mon, 19 Sep 2022 16:08:30 +0000
(16:08 +0000)
committer
Stefan Schmidt
<stefan@datenfreihafen.org>
Fri, 7 Oct 2022 07:29:17 +0000
(09:29 +0200)
Fix to return error code -EINVAL from the error handling
case instead of 0, as done elsewhere in this function.
Fixes: 94160108a70c ("net/ieee802154: fix uninit value bug in dgram_sendmsg")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Link:
https://lore.kernel.org/r/20220919160830.1436109-1-weiyongjun@huaweicloud.com
Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
net/ieee802154/socket.c
patch
|
blob
|
history
diff --git
a/net/ieee802154/socket.c
b/net/ieee802154/socket.c
index 6e55fae4c68604ac5d33eb79c8c33b006be89bbe..1fa2fe041ec033d9b3a35a6cfb54ddbebbdce54a 100644
(file)
--- a/
net/ieee802154/socket.c
+++ b/
net/ieee802154/socket.c
@@
-502,8
+502,10
@@
static int dgram_bind(struct sock *sk, struct sockaddr *uaddr, int len)
if (err < 0)
goto out;
- if (addr->family != AF_IEEE802154)
+ if (addr->family != AF_IEEE802154) {
+ err = -EINVAL;
goto out;
+ }
ieee802154_addr_from_sa(&haddr, &addr->addr);
dev = ieee802154_get_dev(sock_net(sk), &haddr);