summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorYueHaibing <yuehaibing@huawei.com>2018-04-24 11:08:35 +0800
committerJohannes Berg <johannes.berg@intel.com>2018-05-07 15:01:29 +0200
commite8f90c74e6ab64824f3a21521640de7b21050b9d (patch)
treefebf9b5c7bc46a69f334b49de82c55e78e8b744e /drivers
parent2f0605a697f4b9f5b1c1571c7ec6a16df4dc2616 (diff)
downloadlinux-stable-e8f90c74e6ab64824f3a21521640de7b21050b9d.tar.gz
linux-stable-e8f90c74e6ab64824f3a21521640de7b21050b9d.tar.bz2
linux-stable-e8f90c74e6ab64824f3a21521640de7b21050b9d.zip
mac80211_hwsim: fix a possible memory leak in hwsim_new_radio_nl()
'hwname' should be freed before leaving from the error handling cases, otherwise it will cause mem leak Fixes: cb1a5bae5684 ("mac80211_hwsim: add permanent mac address option for new radios") Signed-off-by: YueHaibing <yuehaibing@huawei.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/mac80211_hwsim.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index 96d26cfae90b..4a017a0d71ea 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -3236,6 +3236,7 @@ static int hwsim_new_radio_nl(struct sk_buff *msg, struct genl_info *info)
GENL_SET_ERR_MSG(info,"MAC is no valid source addr");
NL_SET_BAD_ATTR(info->extack,
info->attrs[HWSIM_ATTR_PERM_ADDR]);
+ kfree(hwname);
return -EINVAL;
}