OSDN Git Service

nl802154: Missing return in nl802154_add_llsec_key()
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 2 Oct 2015 07:47:29 +0000 (10:47 +0300)
committerMarcel Holtmann <marcel@holtmann.org>
Fri, 2 Oct 2015 21:34:37 +0000 (23:34 +0200)
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 <dan.carpenter@oracle.com>
Acked-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/ieee802154/nl802154.c

index 1e9e865..16ef0d9 100644 (file)
@@ -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;