Commit 8509cd39 authored by Arik Nemtsov's avatar Arik Nemtsov Committed by Luis Henriques

cfg80211: avoid mem leak on driver hint set

commit 34f05f54 upstream.

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.
Signed-off-by: default avatarArik Nemtsov <arikx.nemtsov@intel.com>
Acked-by: default avatarLuis R. Rodriguez <mcgrof@suse.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
parent 2807b595
...@@ -1720,7 +1720,7 @@ static enum reg_request_treatment ...@@ -1720,7 +1720,7 @@ static enum reg_request_treatment
reg_process_hint_driver(struct wiphy *wiphy, reg_process_hint_driver(struct wiphy *wiphy,
struct regulatory_request *driver_request) struct regulatory_request *driver_request)
{ {
const struct ieee80211_regdomain *regd; const struct ieee80211_regdomain *regd, *tmp;
enum reg_request_treatment treatment; enum reg_request_treatment treatment;
treatment = __reg_process_hint_driver(driver_request); treatment = __reg_process_hint_driver(driver_request);
...@@ -1740,7 +1740,10 @@ reg_process_hint_driver(struct wiphy *wiphy, ...@@ -1740,7 +1740,10 @@ reg_process_hint_driver(struct wiphy *wiphy,
reg_free_request(driver_request); reg_free_request(driver_request);
return REG_REQ_IGNORE; return REG_REQ_IGNORE;
} }
tmp = get_wiphy_regdom(wiphy);
rcu_assign_pointer(wiphy->regd, regd); rcu_assign_pointer(wiphy->regd, regd);
rcu_free_regdom(tmp);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment