linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jouni Malinen <j@w1.fi>
To: "John W. Linville" <linville@tuxdriver.com>,
	Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless@vger.kernel.org
Subject: [PATCH] mac80211: Do not call cfg80211_send_disassoc with rcu held
Date: Fri, 17 Apr 2009 23:04:48 +0300	[thread overview]
Message-ID: <20090417200448.GA24430@jm.kir.nu> (raw)

cfg80211_send_mlme_event() uses GFP_KERNEL and could sleep. Better not
call it with rcu_read_lock held.

Reported-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Jouni Malinen <j@w1.fi>

---
 net/mac80211/mlme.c |   18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

--- uml.orig/net/mac80211/mlme.c	2009-04-16 11:04:05.000000000 +0300
+++ uml/net/mac80211/mlme.c	2009-04-17 23:00:01.000000000 +0300
@@ -874,15 +874,6 @@ static void ieee80211_set_disassoc(struc
 		ieee80211_rx_bss_put(local, bss);
 	}
 
-	if (self_disconnected) {
-		if (deauth)
-			ieee80211_send_deauth_disassoc(sdata,
-				IEEE80211_STYPE_DEAUTH, reason);
-		else
-			ieee80211_send_deauth_disassoc(sdata,
-				IEEE80211_STYPE_DISASSOC, reason);
-	}
-
 	ifmgd->flags &= ~IEEE80211_STA_ASSOCIATED;
 	changed |= ieee80211_reset_erp_info(sdata);
 
@@ -901,6 +892,15 @@ static void ieee80211_set_disassoc(struc
 
 	rcu_read_unlock();
 
+	if (self_disconnected) {
+		if (deauth)
+			ieee80211_send_deauth_disassoc(sdata,
+				IEEE80211_STYPE_DEAUTH, reason);
+		else
+			ieee80211_send_deauth_disassoc(sdata,
+				IEEE80211_STYPE_DISASSOC, reason);
+	}
+
 	/* channel(_type) changes are handled by ieee80211_hw_config */
 	local->oper_channel_type = NL80211_CHAN_NO_HT;
 

-- 
Jouni Malinen                                            PGP id EFC895FA

             reply	other threads:[~2009-04-17 20:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-17 20:04 Jouni Malinen [this message]
2009-04-17 20:27 ` [PATCH] mac80211: Do not call cfg80211_send_disassoc with rcu held Jouni Malinen
2009-04-18 18:53   ` [PATCH] nl80211: Make nl80211_send_mlme_event() atomic Jouni Malinen

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=20090417200448.GA24430@jm.kir.nu \
    --to=j@w1.fi \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /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).