Commit 421eeea1 authored by Baozeng Ding's avatar Baozeng Ding Committed by David S. Miller

ieee802154: fix logic error in ieee802154_llsec_parse_dev_addr

Fix a logic error to avoid potential null pointer dereference.
Signed-off-by: default avatarBaozeng Ding <sploving1@gmail.com>
Reviewed-by: Stefan Schmidt<stefan@osg.samsung.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 86651650
......@@ -1289,8 +1289,8 @@ ieee802154_llsec_parse_dev_addr(struct nlattr *nla,
nl802154_dev_addr_policy))
return -EINVAL;
if (!attrs[NL802154_DEV_ADDR_ATTR_PAN_ID] &&
!attrs[NL802154_DEV_ADDR_ATTR_MODE] &&
if (!attrs[NL802154_DEV_ADDR_ATTR_PAN_ID] ||
!attrs[NL802154_DEV_ADDR_ATTR_MODE] ||
!(attrs[NL802154_DEV_ADDR_ATTR_SHORT] ||
attrs[NL802154_DEV_ADDR_ATTR_EXTENDED]))
return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment