Skip to content

Commit

Permalink
nl802154: fix Oops in ieee802154_nl_get_dev
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dmitry Eremin-Solenikov committed Jun 29, 2009
1 parent e0af606 commit 932c132
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/ieee802154/netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 932c132

Please sign in to comment.