Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 932c1329 authored by Dmitry Eremin-Solenikov's avatar Dmitry Eremin-Solenikov
Browse files

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: default avatarDmitry Eremin-Solenikov <dbaryshkov@gmail.com>
parent e0af6062
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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;