Commit 9ccbe0de authored by Christian Engelmayer's avatar Christian Engelmayer Committed by Greg Kroah-Hartman

ieee802154: Fix memory leak in ieee802154_add_iface()

[ Upstream commit 267d29a6 ]

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>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 72abb47c
...@@ -224,8 +224,10 @@ static int ieee802154_add_iface(struct sk_buff *skb, ...@@ -224,8 +224,10 @@ static int ieee802154_add_iface(struct sk_buff *skb,
if (info->attrs[IEEE802154_ATTR_DEV_TYPE]) { if (info->attrs[IEEE802154_ATTR_DEV_TYPE]) {
type = nla_get_u8(info->attrs[IEEE802154_ATTR_DEV_TYPE]); type = nla_get_u8(info->attrs[IEEE802154_ATTR_DEV_TYPE]);
if (type >= __IEEE802154_DEV_MAX) if (type >= __IEEE802154_DEV_MAX) {
return -EINVAL; rc = -EINVAL;
goto nla_put_failure;
}
} }
dev = phy->add_iface(phy, devname, type); dev = phy->add_iface(phy, devname, type);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment