Skip to content

Commit 098abbd

Browse files
zhengchaoshaojmberg-intel
authored andcommitted
mac80211_hwsim: fix memory leak in hwsim_new_radio_nl
When parse_pmsr_capa failed in hwsim_new_radio_nl, the memory resources applied for by pmsr_capa are not released. Add release processing to the incorrect path. Fixes: 92d1338 ("mac80211_hwsim: add PMSR capability support") Reported-by: [email protected] Signed-off-by: Zhengchao Shao <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Johannes Berg <[email protected]>
1 parent a8938bc commit 098abbd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/net/wireless/virtual/mac80211_hwsim.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5964,10 +5964,11 @@ static int hwsim_new_radio_nl(struct sk_buff *msg, struct genl_info *info)
59645964
ret = -ENOMEM;
59655965
goto out_free;
59665966
}
5967+
param.pmsr_capa = pmsr_capa;
5968+
59675969
ret = parse_pmsr_capa(info->attrs[HWSIM_ATTR_PMSR_SUPPORT], pmsr_capa, info);
59685970
if (ret)
59695971
goto out_free;
5970-
param.pmsr_capa = pmsr_capa;
59715972
}
59725973

59735974
ret = mac80211_hwsim_new_radio(info, &param);

0 commit comments

Comments
 (0)