From: Yuri Ershov Date: Tue, 29 Jun 2010 11:08:07 +0000 (+0400) Subject: nl80211: Fix memory leaks X-Git-Tag: v3.0~4150^2~64^2~16 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d080e2755d840ede60128cc914a070868ebabc1e;p=platform%2Fkernel%2Flinux-amlogic.git nl80211: Fix memory leaks In case of errors during message composing msg should be freed after canceling. Signed-off-by: Yuri Kululin Signed-off-by: Yuri Ershov Signed-off-by: John W. Linville --- diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index fbfac58..37902a5 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -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);