summaryrefslogtreecommitdiffstats
path: root/net/wireless
diff options
context:
space:
mode:
authorweiyongjun (A) <weiyongjun1@huawei.com>2018-03-30 04:07:05 +0200
committerJohannes Berg <johannes.berg@intel.com>2018-04-19 17:02:53 +0200
commit83826469e36b9c8219f88c16713a755b2cea6ff5 (patch)
tree1c1f2887c220bd7f3cdcadcaa2b3d06839df4211 /net/wireless
parentcfg80211: limit wiphy names to 128 bytes (diff)
downloadlinux-83826469e36b9c8219f88c16713a755b2cea6ff5.tar.xz
linux-83826469e36b9c8219f88c16713a755b2cea6ff5.zip
cfg80211: fix possible memory leak in regdb_query_country()
'wmm_ptrs' is malloced in regdb_query_country() and should be freed before leaving from the error handling cases, otherwise it will cause memory leak. Fixes: 230ebaa189af ("cfg80211: read wmm rules from regulatory database") Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> [johannes: add Fixes tag] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless')
-rw-r--r--net/wireless/reg.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 16c7e4ef5820..ac3e12c32aa3 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -1026,6 +1026,7 @@ static int regdb_query_country(const struct fwdb_header *db,
if (!tmp_rd) {
kfree(regdom);
+ kfree(wmm_ptrs);
return -ENOMEM;
}
regdom = tmp_rd;