summaryrefslogtreecommitdiffstats
path: root/net/wireless
diff options
context:
space:
mode:
authorWei Yongjun <weiyongjun1@huawei.com>2016-10-17 17:25:16 +0200
committerJohannes Berg <johannes.berg@intel.com>2016-10-18 08:52:00 +0200
commit320c975f180b19296f0fd6c5bf2144e633aaba5e (patch)
tree4e70d46d96e0588bb0d5061079d979454634ae34 /net/wireless
parentmac80211: fix A-MSDU outer SA/DA (diff)
downloadlinux-320c975f180b19296f0fd6c5bf2144e633aaba5e.tar.xz
linux-320c975f180b19296f0fd6c5bf2144e633aaba5e.zip
cfg80211: fix possible memory leak in cfg80211_iter_combinations()
'limits' is malloced in cfg80211_iter_combinations() and should be freed before leaving from the error handling cases, otherwise it will cause memory leak. Fixes: 0c317a02ca98 ("cfg80211: support virtual interfaces with different beacon intervals") Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless')
-rw-r--r--net/wireless/util.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/wireless/util.c b/net/wireless/util.c
index d2ea1f152d17..ec17c2800117 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -1676,8 +1676,10 @@ int cfg80211_iter_combinations(struct wiphy *wiphy,
if (params->beacon_int_gcd) {
if (c->beacon_int_min_gcd &&
- params->beacon_int_gcd < c->beacon_int_min_gcd)
+ params->beacon_int_gcd < c->beacon_int_min_gcd) {
+ kfree(limits);
return -EINVAL;
+ }
if (!c->beacon_int_min_gcd &&
params->beacon_int_different)
goto cont;