Skip to content

Commit 1399c59

Browse files
Navidemjmberg-intel
authored andcommitted
nl80211: fix memory leak in nl80211_get_ftm_responder_stats
In nl80211_get_ftm_responder_stats, a new skb is created via nlmsg_new named msg. If nl80211hdr_put() fails, then msg should be released. The return statement should be replace by goto to error handling code. Fixes: 81e54d0 ("cfg80211: support FTM responder configuration/statistics") Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com> Link: https://lore.kernel.org/r/20191004194220.19412-1-navid.emamdoost@gmail.com Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent 4ac2813 commit 1399c59

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: net/wireless/nl80211.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -13682,7 +13682,7 @@ static int nl80211_get_ftm_responder_stats(struct sk_buff *skb,
1368213682
hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0,
1368313683
NL80211_CMD_GET_FTM_RESPONDER_STATS);
1368413684
if (!hdr)
13685-
return -ENOBUFS;
13685+
goto nla_put_failure;
1368613686

1368713687
if (nla_put_u32(msg, NL80211_ATTR_IFINDEX, dev->ifindex))
1368813688
goto nla_put_failure;

0 commit comments

Comments
 (0)