diff options
author | Arik Nemtsov <arik@wizery.com> | 2014-12-04 13:22:16 +0300 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2014-12-12 14:25:33 +0300 |
commit | 34f05f543f02350e920bddb7660ffdd4697aaf60 (patch) | |
tree | 30dc48d68dada17d558e433c9a59fa0055cc46c7 /net | |
parent | 08f6f147773b23b765b94633a8eaa82e7defcf4c (diff) | |
download | linux-34f05f543f02350e920bddb7660ffdd4697aaf60.tar.xz |
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')
-rw-r--r-- | net/wireless/reg.c | 5 |
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); } |