Skip to content

Commit 984cfd5

Browse files
mudongliangStefan-Schmidt
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Stefan Schmidt <[email protected]>
1 parent 748b2f5 commit 984cfd5

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

net/ieee802154/nl802154.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2488,8 +2488,7 @@ static int nl802154_del_llsec_seclevel(struct sk_buff *skb,
24882488
if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR)
24892489
return -EOPNOTSUPP;
24902490

2491-
if (!info->attrs[NL802154_ATTR_SEC_LEVEL] ||
2492-
llsec_parse_seclevel(info->attrs[NL802154_ATTR_SEC_LEVEL],
2491+
if (llsec_parse_seclevel(info->attrs[NL802154_ATTR_SEC_LEVEL],
24932492
&sl) < 0)
24942493
return -EINVAL;
24952494

0 commit comments

Comments
 (0)