summaryrefslogtreecommitdiffstats
path: root/net/ieee802154
diff options
context:
space:
mode:
authorDongliang Mu <dzm91@hust.edu.cn>2023-03-08 09:32:31 +0100
committerStefan Schmidt <stefan@datenfreihafen.org>2023-03-17 09:13:53 +0100
commit984cfd55e0c99e80b2e5b1dc6b2bf98608af7ff9 (patch)
tree51a6e9b16a9c719b70ba49e1a499addd6ff34563 /net/ieee802154
parentca8210: Fix unsigned mac_len comparison with zero in ca8210_skb_tx() (diff)
downloadlinux-984cfd55e0c99e80b2e5b1dc6b2bf98608af7ff9.tar.xz
linux-984cfd55e0c99e80b2e5b1dc6b2bf98608af7ff9.zip
net: ieee802154: remove an unnecessary null pointer check
llsec_parse_seclevel has the null pointer check at its begining. Compared with nl802154_add_llsec_seclevel, nl802154_del_llsec_seclevel has a redundant null pointer check of info->attrs[NL802154_ATTR_SEC_LEVEL] before llsec_parse_seclevel. Fix this issue by removing the null pointer check in nl802154_del_llsec_seclevel. Signed-off-by: Dongliang Mu <dzm91@hust.edu.cn> Link: https://lore.kernel.org/r/20230308083231.460015-1-dzm91@hust.edu.cn Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
Diffstat (limited to 'net/ieee802154')
-rw-r--r--net/ieee802154/nl802154.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c
index d8f4379d4fa6..832e3c50816c 100644
--- a/net/ieee802154/nl802154.c
+++ b/net/ieee802154/nl802154.c
@@ -2488,8 +2488,7 @@ static int nl802154_del_llsec_seclevel(struct sk_buff *skb,
if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR)
return -EOPNOTSUPP;
- if (!info->attrs[NL802154_ATTR_SEC_LEVEL] ||
- llsec_parse_seclevel(info->attrs[NL802154_ATTR_SEC_LEVEL],
+ if (llsec_parse_seclevel(info->attrs[NL802154_ATTR_SEC_LEVEL],
&sl) < 0)
return -EINVAL;