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

Commit 267d29a6 authored by Christian Engelmayer's avatar Christian Engelmayer Committed by David S. Miller
Browse files

ieee802154: Fix memory leak in ieee802154_add_iface()



Fix a memory leak in the ieee802154_add_iface() error handling path.
Detected by Coverity: CID 710490.

Signed-off-by: default avatarChristian Engelmayer <cengelma@gmx.at>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fdc3452c
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -221,8 +221,10 @@ int ieee802154_add_iface(struct sk_buff *skb, struct genl_info *info)

	if (info->attrs[IEEE802154_ATTR_DEV_TYPE]) {
		type = nla_get_u8(info->attrs[IEEE802154_ATTR_DEV_TYPE]);
		if (type >= __IEEE802154_DEV_MAX)
			return -EINVAL;
		if (type >= __IEEE802154_DEV_MAX) {
			rc = -EINVAL;
			goto nla_put_failure;
		}
	}

	dev = phy->add_iface(phy, devname, type);