linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Wunderlich <sw@simonwunderlich.de>
To: johannes@sipsolutions.net
Cc: linux-wireless@vger.kernel.org, Simon Wunderlich <sw@simonwunderlich.de>
Subject: [PATCH 4/4] mac80211: don't leak next beacon when csa is aborted
Date: Thu, 21 Nov 2013 16:56:23 +0100	[thread overview]
Message-ID: <1385049383-5617-5-git-send-email-sw@simonwunderlich.de> (raw)
In-Reply-To: <1385049383-5617-1-git-send-email-sw@simonwunderlich.de>

Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
---
 net/mac80211/cfg.c   |    5 +++++
 net/mac80211/iface.c |    7 ++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 9f19cde..8bf0cc0 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1079,7 +1079,12 @@ static int ieee80211_stop_ap(struct wiphy *wiphy, struct net_device *dev)
 	old_probe_resp = sdata_dereference(sdata->u.ap.probe_resp, sdata);
 
 	/* abort any running channel switch */
+	if (sdata->vif.csa_active) {
+		kfree(sdata->u.ap.next_beacon);
+		sdata->u.ap.next_beacon = NULL;
+	}
 	sdata->vif.csa_active = false;
+
 	cancel_work_sync(&sdata->u.ap.request_smps_work);
 
 	/* turn off carrier for this interface and dependent VLANs */
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index d226751..dce4398 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -820,8 +820,13 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
 	cancel_work_sync(&local->dynamic_ps_enable_work);
 
 	cancel_work_sync(&sdata->recalc_smps);
-	sdata->vif.csa_active = false;
 	cancel_work_sync(&sdata->csa_finalize_work);
+	/* free left-over next beacon if a CSA was aborted */
+	if (sdata->vif.csa_active && sdata->vif.type == NL80211_IFTYPE_AP) {
+		kfree(sdata->u.ap.next_beacon);
+		sdata->u.ap.next_beacon = NULL;
+	}
+	sdata->vif.csa_active = false;
 
 	cancel_delayed_work_sync(&sdata->dfs_cac_timer_work);
 
-- 
1.7.10.4


      parent reply	other threads:[~2013-11-21 15:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-21 15:56 [PATCH 0/4] Fix CSA locking issues Simon Wunderlich
2013-11-21 15:56 ` [PATCH 1/4] cfg80211/mac80211: modify beacon using sdata/wdev-lock, not rtnl lock Simon Wunderlich
2013-11-21 15:56 ` [PATCH 2/4] cfg80211/mac80211/ath6kl: acquire wdev lock outside ch_switch_notify Simon Wunderlich
2013-11-21 15:56 ` [PATCH 3/4] mac80211: don't cancel csa finalize work within stop_ap Simon Wunderlich
2013-11-21 15:56 ` Simon Wunderlich [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1385049383-5617-5-git-send-email-sw@simonwunderlich.de \
    --to=sw@simonwunderlich.de \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).