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: syzbot+904ce6fbb38532d9795c@syzkaller.appspotmail.com Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com> Reviewed-by: Simon Horman <simon.horman@corigine.com> Link: https://lore.kernel.org/r/20230515092227.2691437-1-shaozhengchao@huawei.com Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent a8938bc commit 098abbd

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

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)