mac80211_hwsim: fix possible memory leak in hwsim_new_radio_nl()
authorweiyongjun (A) <weiyongjun1@huawei.com>
Thu, 18 Jan 2018 02:23:34 +0000 (02:23 +0000)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 19 Apr 2018 10:13:03 +0000 (11:13 +0100)
commit8296fd96510c53006eee0ba0fcb74b4db0b5274f
tree249467207f1efd11f27d8247ba1f43d545034464
parentcdcab5075929051e1b37bae43da17acd467d6cb8
mac80211_hwsim: fix possible memory leak in hwsim_new_radio_nl()

'hwname' is malloced in hwsim_new_radio_nl() and should be freed
before leaving from the error handling cases, otherwise it will cause
memory leak.

Fixes: ff4dd73dd2b4 ("mac80211_hwsim: check HWSIM_ATTR_RADIO_NAME length")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name mac80211_hwsim-fix-possible-memory-leak-in-hwsim_new.patch
drivers/net/wireless/mac80211_hwsim.c