summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorNiko Jokinen <ext-niko.k.jokinen@nokia.com>2009-07-15 10:00:53 +0200
committerJohn W. Linville <linville@tuxdriver.com>2009-07-21 18:07:42 +0200
commit6c95e2a2f0f0bf4c8880d5b74b2f7f359d352d03 (patch)
tree9758902b92cbde1890339f4747678b0511ee7ac4 /net
parentrtl8187: Fix for kernel oops when unloading with LEDs enabled (diff)
downloadlinux-6c95e2a2f0f0bf4c8880d5b74b2f7f359d352d03.tar.xz
linux-6c95e2a2f0f0bf4c8880d5b74b2f7f359d352d03.zip
nl80211: Memory leak fixed
Potential memory leak via msg pointer in nl80211_get_key() function. Signed-off-by: Niko Jokinen <ext-niko.k.jokinen@nokia.com> Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net')
-rw-r--r--net/wireless/nl80211.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 43bdb1372cae..634496b3ed77 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -997,7 +997,7 @@ static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info)
if (IS_ERR(hdr)) {
err = PTR_ERR(hdr);
- goto out;
+ goto free_msg;
}
cookie.msg = msg;
@@ -1011,7 +1011,7 @@ static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info)
&cookie, get_key_callback);
if (err)
- goto out;
+ goto free_msg;
if (cookie.error)
goto nla_put_failure;
@@ -1022,6 +1022,7 @@ static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info)
nla_put_failure:
err = -ENOBUFS;
+ free_msg:
nlmsg_free(msg);
out:
cfg80211_put_dev(drv);