mac80211_hwsim: fix memory leak in hwsim_new_radio_nl
authorZhengchao Shao <shaozhengchao@huawei.com>
Mon, 15 May 2023 09:22:27 +0000 (17:22 +0800)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 16 May 2023 17:29:34 +0000 (10:29 -0700)
commit098abbd48ec1accf111dde50a2a5392f2a15f59c
tree62c478976a5d110c0ece2cb945df20cd2d877dc7
parenta8938bc881d2a03f9b77f19fae924fe798a01285
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: 92d13386ec55 ("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>
drivers/net/wireless/virtual/mac80211_hwsim.c