summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBaozeng Ding <sploving1@gmail.com>2016-05-26 15:07:42 +0200
committerDavid S. Miller <davem@davemloft.net>2016-05-30 07:36:25 +0200
commit421eeea10d0a5e52256bce9544de477938104fdb (patch)
treeca3ff196e261ca492247d2490cc951948a23c218
parentnet: nps_enet: Disable interrupts before napi reschedule (diff)
downloadlinux-421eeea10d0a5e52256bce9544de477938104fdb.tar.xz
linux-421eeea10d0a5e52256bce9544de477938104fdb.zip
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>
-rw-r--r--net/ieee802154/nl802154.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c
index ca207dbf673b..116187b5c267 100644
--- a/net/ieee802154/nl802154.c
+++ b/net/ieee802154/nl802154.c
@@ -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;