summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorChristian Engelmayer <cengelma@gmx.at>2014-01-11 22:19:30 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-02-06 11:08:16 -0800
commit9ccbe0de27de9d387f480d7b721140aee68b25c4 (patch)
treee27a951d4d3430d0b71021f9ea1d988af66abf2c /net
parent72abb47c577499379a83a2f065d282936b4464f4 (diff)
downloadlinux-3.10-9ccbe0de27de9d387f480d7b721140aee68b25c4.tar.gz
linux-3.10-9ccbe0de27de9d387f480d7b721140aee68b25c4.tar.bz2
linux-3.10-9ccbe0de27de9d387f480d7b721140aee68b25c4.zip
ieee802154: Fix memory leak in ieee802154_add_iface()
[ Upstream commit 267d29a69c6af39445f36102a832b25ed483f299 ] 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net')
-rw-r--r--net/ieee802154/nl-phy.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/ieee802154/nl-phy.c b/net/ieee802154/nl-phy.c
index 22b1a7058fd..4efd2375d7e 100644
--- a/net/ieee802154/nl-phy.c
+++ b/net/ieee802154/nl-phy.c
@@ -224,8 +224,10 @@ static int ieee802154_add_iface(struct sk_buff *skb,
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);