nl802154: add support for security layer
Subsystems (3)
Hello Alexander Aring,
The patch a26c5fd7622d: "nl802154: add support for security layer" from Sep 28, 2015, leads to the following static checker warning:
net/ieee802154/nl802154.c:1535 nl802154_add_llsec_key() warn: if statement not indented
net/ieee802154/nl802154.c
1530 if (nla_parse_nested(attrs, NL802154_KEY_ATTR_MAX,
1531 info->attrs[NL802154_ATTR_SEC_KEY],
1532 nl802154_key_policy))
1533 return -EINVAL;
1534
1535 if (!attrs[NL802154_KEY_ATTR_USAGE_FRAMES] ||
1536 !attrs[NL802154_KEY_ATTR_BYTES])
Should this be a return -EINVAL?
1537
1538 if (ieee802154_llsec_parse_key_id(attrs[NL802154_KEY_ATTR_ID], &id) < 0)
1539 return -ENOBUFS;
1540
regards,
dan carpenter
Alexander Aring
maintainerHello Dan Carpenter,
Quoted 17 lines · Dan Carpenter
Hello Alexander Aring,
The patch
a26c5fd7622d: "nl802154: add support for security layer" from Sep 28, 2015, leads to the following static checker warning:net/ieee802154/nl802154.c:1535 nl802154_add_llsec_key() warn: if statement not indented
net/ieee802154/nl802154.c
1530 if (nla_parse_nested(attrs,NL802154_KEY_ATTR_MAX,
1531 info->attrs[NL802154_ATTR_SEC_KEY],
1532nl802154_key_policy))
1533 return-EINVAL;
1534
1535 if (!attrs[NL802154_KEY_ATTR_USAGE_FRAMES] ||
1536 !attrs[NL802154_KEY_ATTR_BYTES])
Quoted 2 lines
Should this be a return
-EINVAL?
Yes. Can you please provide a patch which based on bluetooth-next to linux-wpan mailinglist?
Thanks.
- Alex
PATCH 1/1 nl802154: Missing return in nl802154_add_llsec_key()
There was a missing return here so it meant that often ieee802154_llsec_parse_key_id() was not called.
net/ieee802154/nl802154.c +1 -0
@@ -1534,6 +1534,7 @@ static int nl802154_add_llsec_key(struct sk_buff *skb, struct genl_info *info)if (!attrs[NL802154_KEY_ATTR_USAGE_FRAMES ] || !attrs[NL802154_KEY_ATTR_BYTES ]) +return -EINVAL ;if (ieee802154_llsec_parse_key_id (attrs[NL802154_KEY_ATTR_ID ], &id) <0 )return -ENOBUFS ;
Re: [patch] nl802154: Missing return in nl802154_add_llsec_key()
Hi,
Quoted 6 lines · Dan Carpenter
There was a missing return here so it meant that often
ieee802154_llsec_parse_key_id()was not called.Fixes a26c5fd7622d ('nl802154: add support for security layer')Signed-off-by Dan Carpenter <[email protected]>
Thanks.
- Alex
Re: [patch] nl802154: Missing return in nl802154_add_llsec_key()
In reply to Dan CarpenterHi Dan,
Quoted 5 lines
There was a missing return here so it meant that often
ieee802154_llsec_parse_key_id()was not called.Fixes a26c5fd7622d ('nl802154: add support for security layer')Signed-off-by Dan Carpenter <[email protected]>
patch has been applied to bluetooth-next tree.
Regards
Marcel