Skip to content

Commit

Permalink
ieee802154: Fix memory leak in ieee802154_add_iface()
Browse files Browse the repository at this point in the history
Fix a memory leak in the ieee802154_add_iface() error handling path.
Detected by Coverity: CID 710490.

Signed-off-by: Christian Engelmayer <cengelma@gmx.at>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Christian Engelmayer authored and David S. Miller committed Jan 14, 2014
1 parent fdc3452 commit 267d29a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions net/ieee802154/nl-phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 267d29a

Please sign in to comment.