Skip to content

Commit 444d8ad

Browse files
Wei YongjunStefan-Schmidt
authored andcommitted
net: ieee802154: fix error return code in dgram_bind()
Fix to return error code -EINVAL from the error handling case instead of 0, as done elsewhere in this function. Fixes: 9416010 ("net/ieee802154: fix uninit value bug in dgram_sendmsg") Signed-off-by: Wei Yongjun <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Stefan Schmidt <[email protected]>
1 parent 68fe1db commit 444d8ad

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

net/ieee802154/socket.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,8 +502,10 @@ static int dgram_bind(struct sock *sk, struct sockaddr *uaddr, int len)
502502
if (err < 0)
503503
goto out;
504504

505-
if (addr->family != AF_IEEE802154)
505+
if (addr->family != AF_IEEE802154) {
506+
err = -EINVAL;
506507
goto out;
508+
}
507509

508510
ieee802154_addr_from_sa(&haddr, &addr->addr);
509511
dev = ieee802154_get_dev(sock_net(sk), &haddr);

0 commit comments

Comments
 (0)