提交 3122ba7e 编写于 作者: W Wei Yongjun 提交者: Lipeng Sang

net: ieee802154: fix error return code in dgram_bind()

stable inclusion
from stable-v5.10.153
commit 9d00384270b15ed19c3987effe826b061b567171
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I64YCA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=9d00384270b15ed19c3987effe826b061b567171

--------------------------------

commit 444d8ad4 upstream.

Fix to return error code -EINVAL from the error handling
case instead of 0, as done elsewhere in this function.

Fixes: 94160108 ("net/ieee802154: fix uninit value bug in dgram_sendmsg")
Signed-off-by: NWei Yongjun <weiyongjun1@huawei.com>
Link: https://lore.kernel.org/r/20220919160830.1436109-1-weiyongjun@huaweicloud.comSigned-off-by: NStefan Schmidt <stefan@datenfreihafen.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NLipeng Sang <sanglipeng1@jd.com>
上级 744d942e
......@@ -503,8 +503,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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册