summaryrefslogtreecommitdiffstats
path: root/net/wireless/reg.c
diff options
context:
space:
mode:
authorArik Nemtsov <arik@wizery.com>2014-12-04 11:22:16 +0100
committerJohannes Berg <johannes.berg@intel.com>2014-12-12 12:25:33 +0100
commit34f05f543f02350e920bddb7660ffdd4697aaf60 (patch)
tree30dc48d68dada17d558e433c9a59fa0055cc46c7 /net/wireless/reg.c
parentcfg80211: Fix 160 MHz channels with 80+80 and 160 MHz drivers (diff)
downloadlinux-34f05f543f02350e920bddb7660ffdd4697aaf60.tar.xz
linux-34f05f543f02350e920bddb7660ffdd4697aaf60.zip
cfg80211: avoid mem leak on driver hint set
In the already-set and intersect case of a driver-hint, the previous wiphy regdomain was not freed before being reset with a copy of the cfg80211 regdomain. Cc: stable@vger.kernel.org Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com> Acked-by: Luis R. Rodriguez <mcgrof@suse.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless/reg.c')
-rw-r--r--net/wireless/reg.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 47be6163381c..7ddd16a51adf 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -1907,7 +1907,7 @@ static enum reg_request_treatment
reg_process_hint_driver(struct wiphy *wiphy,
struct regulatory_request *driver_request)
{
- const struct ieee80211_regdomain *regd;
+ const struct ieee80211_regdomain *regd, *tmp;
enum reg_request_treatment treatment;
treatment = __reg_process_hint_driver(driver_request);
@@ -1927,7 +1927,10 @@ reg_process_hint_driver(struct wiphy *wiphy,
reg_free_request(driver_request);
return REG_REQ_IGNORE;
}
+
+ tmp = get_wiphy_regdom(wiphy);
rcu_assign_pointer(wiphy->regd, regd);
+ rcu_free_regdom(tmp);
}