]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
nl80211: Fix memory leaks
authorYuri Ershov <ext-yuri.ershov@nokia.com>
Tue, 29 Jun 2010 11:08:07 +0000 (15:08 +0400)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 28 Jul 2010 20:24:01 +0000 (16:24 -0400)
In case of errors during message composing msg should be freed after canceling.

Signed-off-by: Yuri Kululin <ext-yuri.kululin@nokia.com>
Signed-off-by: Yuri Ershov <ext-yuri.ershov@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/wireless/nl80211.c

index fbfac588297cd248337f9ea2cfd2d1bd52ea686d..37902a54e9c154fb8dbed3e1d996d8a198bdc17b 100644 (file)
@@ -2769,6 +2769,7 @@ static int nl80211_get_mesh_params(struct sk_buff *skb,
 
  nla_put_failure:
        genlmsg_cancel(msg, hdr);
+       nlmsg_free(msg);
        err = -EMSGSIZE;
  out:
        /* Cleanup */
@@ -2960,6 +2961,7 @@ static int nl80211_get_reg(struct sk_buff *skb, struct genl_info *info)
 
 nla_put_failure:
        genlmsg_cancel(msg, hdr);
+       nlmsg_free(msg);
        err = -EMSGSIZE;
 out:
        mutex_unlock(&cfg80211_mutex);