ieee802154: missing put_dev() on error
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 22 May 2014 07:53:06 +0000 (10:53 +0300)
committerDavid S. Miller <davem@davemloft.net>
Thu, 22 May 2014 19:54:45 +0000 (15:54 -0400)
We should call put_dev() on the error path here.

Fixes: 3e9c156e2c21 ('ieee802154: add netlink interfaces for llsec')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ieee802154/nl-mac.c

index 5617b4c..a3281b8 100644 (file)
@@ -832,8 +832,10 @@ int ieee802154_llsec_getparams(struct sk_buff *skb, struct genl_info *info)
                return -ENODEV;
 
        ops = ieee802154_mlme_ops(dev);
-       if (!ops->llsec)
-               return -EOPNOTSUPP;
+       if (!ops->llsec) {
+               rc = -EOPNOTSUPP;
+               goto out_dev;
+       }
 
        msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
        if (!msg)