All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cfg80211: avoid mem leak on driver hint set
@ 2014-12-04 10:22 Arik Nemtsov
  2014-12-04 17:37 ` Luis R. Rodriguez
  2014-12-12 11:25 ` Johannes Berg
  0 siblings, 2 replies; 3+ messages in thread
From: Arik Nemtsov @ 2014-12-04 10:22 UTC (permalink / raw
  To: linux-wireless; +Cc: Johannes Berg, Luis R. Rodriguez, Arik Nemtsov, stable

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>
---
 net/wireless/reg.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 004ea14..8941e1c 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -1916,7 +1916,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);
@@ -1936,7 +1936,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);
 	}
 
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] cfg80211: avoid mem leak on driver hint set
  2014-12-04 10:22 [PATCH] cfg80211: avoid mem leak on driver hint set Arik Nemtsov
@ 2014-12-04 17:37 ` Luis R. Rodriguez
  2014-12-12 11:25 ` Johannes Berg
  1 sibling, 0 replies; 3+ messages in thread
From: Luis R. Rodriguez @ 2014-12-04 17:37 UTC (permalink / raw
  To: Arik Nemtsov; +Cc: linux-wireless, Johannes Berg, stable

On Thu, Dec 04, 2014 at 12:22:16PM +0200, Arik Nemtsov wrote:
> 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>

  Luis

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] cfg80211: avoid mem leak on driver hint set
  2014-12-04 10:22 [PATCH] cfg80211: avoid mem leak on driver hint set Arik Nemtsov
  2014-12-04 17:37 ` Luis R. Rodriguez
@ 2014-12-12 11:25 ` Johannes Berg
  1 sibling, 0 replies; 3+ messages in thread
From: Johannes Berg @ 2014-12-12 11:25 UTC (permalink / raw
  To: Arik Nemtsov; +Cc: linux-wireless, Luis R. Rodriguez, stable

On Thu, 2014-12-04 at 12:22 +0200, Arik Nemtsov wrote:
> 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.

Applied.

johannes


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-12-12 11:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-04 10:22 [PATCH] cfg80211: avoid mem leak on driver hint set Arik Nemtsov
2014-12-04 17:37 ` Luis R. Rodriguez
2014-12-12 11:25 ` Johannes Berg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.