]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
mac802154: move dev_hold out of ieee802154_if_add
authorAlexander Aring <alex.aring@gmail.com>
Wed, 5 Nov 2014 19:51:16 +0000 (20:51 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Wed, 5 Nov 2014 20:53:03 +0000 (21:53 +0100)
This patch moves the dev_hold call inside of nl-phy ieee802154_add_iface
function. The ieee802154_add_iface is the only one function which use the
ieee802154_if_add function and contains the corresponding dev_put call.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/ieee802154/nl-phy.c
net/mac802154/iface.c

index 5d914d30e0b14ce34b4d959b6641c1fbcb7fdd14..397ca126d9a236bd7b16a386f462bf1bbe8fd834 100644 (file)
@@ -226,6 +226,7 @@ int ieee802154_add_iface(struct sk_buff *skb, struct genl_info *info)
                rc = PTR_ERR(dev);
                goto nla_put_failure;
        }
+       dev_hold(dev);
 
        if (info->attrs[IEEE802154_ATTR_HW_ADDR]) {
                struct sockaddr addr;
index fced04b052755fcdfb5e7509d6b1f3c099d60662..78cb38124a2a0022d1bd51749ea43b90f7454ee7 100644 (file)
@@ -501,7 +501,6 @@ ieee802154_if_add(struct ieee802154_local *local, const char *name,
        if (err)
                goto err_free;
 
-       dev_hold(dev); /* we return an incremented device refcount */
        return dev;
 
 err_free: