nl802154: fix Oops in ieee802154_nl_get_dev
authorDmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Fri, 19 Jun 2009 13:00:08 +0000 (17:00 +0400)
committerDmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Mon, 29 Jun 2009 14:20:27 +0000 (18:20 +0400)
ieee802154_nl_get_dev() lacks check for the existance of the device
that was returned by dev_get_XXX, thus resulting in Oops for non-existing
devices. Fix it.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
net/ieee802154/netlink.c

index 105ad10876afe3dc06d2a5d2002900b297601879..332b947ae8122b86142fd5b31837a07696d10c28 100644 (file)
@@ -276,6 +276,9 @@ static struct net_device *ieee802154_nl_get_dev(struct genl_info *info)
        else
                return NULL;
 
+       if (!dev)
+               return NULL;
+
        if (dev->type != ARPHRD_IEEE802154) {
                dev_put(dev);
                return NULL;