Skip to content

Commit a7b2c7f

Browse files
ariknemgregkh
authored andcommitted
cfg80211: avoid mem leak on driver hint set
commit 34f05f5 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: Arik Nemtsov <arikx.nemtsov@intel.com> Acked-by: Luis R. Rodriguez <mcgrof@suse.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 0a57c26 commit a7b2c7f

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎net/wireless/reg.c‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1760,7 +1760,7 @@ static enum reg_request_treatment
17601760
reg_process_hint_driver(struct wiphy *wiphy,
17611761
struct regulatory_request *driver_request)
17621762
{
1763-
const struct ieee80211_regdomain *regd;
1763+
const struct ieee80211_regdomain *regd, *tmp;
17641764
enum reg_request_treatment treatment;
17651765

17661766
treatment = __reg_process_hint_driver(driver_request);
@@ -1780,7 +1780,10 @@ reg_process_hint_driver(struct wiphy *wiphy,
17801780
reg_free_request(driver_request);
17811781
return REG_REQ_IGNORE;
17821782
}
1783+
1784+
tmp = get_wiphy_regdom(wiphy);
17831785
rcu_assign_pointer(wiphy->regd, regd);
1786+
rcu_free_regdom(tmp);
17841787
}
17851788

17861789

0 commit comments

Comments
 (0)