summaryrefslogtreecommitdiffstats
path: root/net/ieee802154/netlink.c
diff options
context:
space:
mode:
authorDmitry Eremin-Solenikov <dbaryshkov@gmail.com>2009-06-19 15:00:08 +0200
committerDmitry Eremin-Solenikov <dbaryshkov@gmail.com>2009-06-29 16:20:27 +0200
commit932c1329acebc03ef5efa3647c9c3a967b59d0c4 (patch)
treec0e281f5074ea0e655543eba8a766d0fe500c8bd /net/ieee802154/netlink.c
parentMAINTAINERS: ieee802154 lists are moderated for non-subscribers. (diff)
downloadlinux-932c1329acebc03ef5efa3647c9c3a967b59d0c4.tar.xz
linux-932c1329acebc03ef5efa3647c9c3a967b59d0c4.zip
nl802154: fix Oops in ieee802154_nl_get_dev
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>
Diffstat (limited to 'net/ieee802154/netlink.c')
-rw-r--r--net/ieee802154/netlink.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/ieee802154/netlink.c b/net/ieee802154/netlink.c
index 105ad10876af..332b947ae812 100644
--- a/net/ieee802154/netlink.c
+++ b/net/ieee802154/netlink.c
@@ -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;