Skip to content

Commit

Permalink
nl80211: Fix memory leaks
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Yuri Ershov authored and John W. Linville committed Jul 28, 2010
1 parent e4ab7eb commit d080e27
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/wireless/nl80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit d080e27

Please sign in to comment.