ieee802154: Fix memory leak in ieee802154_add_iface()
Subsystems (3)
PATCH 1/1 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 Christian Engelmayer <[email protected]>
---
This patch fixes an issue introduced in
commit 90c049b2c6ae26d1a4d526d660a976620eaa554a
Author: [email protected] <[email protected]>
Date: Tue May 15 20:50:27 2012 +0000
ieee802154: interface type to be added
--- net/ieee802154/nl-phy.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
net/ieee802154/nl-phy.c +4 -2
@@ -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);
Signature · 1 line
1.8.3.2
David Miller
maintainerFrom: Christian Engelmayer <[email protected]>
Date: Sat, 11 Jan 2014 22:19:30 +0100
Quoted 4 lines
Fix a memory leak in the
ieee802154_add_iface()error handling path. Detected by Coverity: CID 710490.Signed-off-by Christian Engelmayer <[email protected]>
Applied and queued up for -stable, thanks.