mirror of
https://github.com/torvalds/linux.git
synced 2026-06-06 21:45:45 +02:00
net: ieee802154: fix error return code in dgram_bind()
commit444d8ad491upstream. Fix to return error code -EINVAL from the error handling case instead of 0, as done elsewhere in this function. Fixes:94160108a7("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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
568e3812b1
commit
9d00384270
|
|
@ -503,8 +503,10 @@ static int dgram_bind(struct sock *sk, struct sockaddr *uaddr, int len)
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
if (addr->family != AF_IEEE802154)
|
if (addr->family != AF_IEEE802154) {
|
||||||
|
err = -EINVAL;
|
||||||
goto out;
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
ieee802154_addr_from_sa(&haddr, &addr->addr);
|
ieee802154_addr_from_sa(&haddr, &addr->addr);
|
||||||
dev = ieee802154_get_dev(sock_net(sk), &haddr);
|
dev = ieee802154_get_dev(sock_net(sk), &haddr);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user