ieee802154: fix logic error in ieee802154_llsec_parse_dev_addr

Fix a logic error to avoid potential null pointer dereference.

Signed-off-by: Baozeng Ding <sploving1@gmail.com>
Reviewed-by: Stefan Schmidt<stefan@osg.samsung.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Baozeng Ding 2016-05-26 21:07:42 +08:00 committed by David S. Miller
parent 86651650d1
commit 421eeea10d
1 changed files with 2 additions and 2 deletions

View File

@ -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;