linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Roskin <proski@gnu.org>
To: Lennert Buytenhek <buytenh@marvell.com>,
	linux-wireless@vger.kernel.org,
	"John W. Linville" <linville@tuxdriver.com>
Subject: [PATCH] mwl8k: disable softirqs when accessing sta_notify_list
Date: Sat, 13 Feb 2010 22:13:06 -0500	[thread overview]
Message-ID: <1266117186.13902.21.camel@mj> (raw)

Use spin_[un]lock_bh in mwl8k_sta_notify().  The sta_notify handler is
required to be atomic, yet it can be called in process context, so make
sure one call won't preempt another.

Signed-off-by: Pavel Roskin <proski@gnu.org>
---
I found it by accident (sparse reported it, but presumably for a wrong
reason) and I have no hardware to test the patch on, but I believe it's
correct.

 drivers/net/wireless/mwl8k.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c
index 0cfdb9d..6497c84 100644
--- a/drivers/net/wireless/mwl8k.c
+++ b/drivers/net/wireless/mwl8k.c
@@ -3784,9 +3784,9 @@ mwl8k_sta_notify(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
 		s->cmd = cmd;
 		s->sta = *sta;
 
-		spin_lock(&priv->sta_notify_list_lock);
+		spin_lock_bh(&priv->sta_notify_list_lock);
 		list_add_tail(&s->list, &priv->sta_notify_list);
-		spin_unlock(&priv->sta_notify_list_lock);
+		spin_unlock_bh(&priv->sta_notify_list_lock);
 
 		ieee80211_queue_work(hw, &priv->sta_notify_worker);
 	}
-- 
Regards,
Pavel Roskin

             reply	other threads:[~2010-02-14  3:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-14  3:13 Pavel Roskin [this message]
2010-02-16 20:03 ` [PATCH] mwl8k: disable softirqs when accessing sta_notify_list Luis R. Rodriguez
2010-02-16 21:28   ` Pavel Roskin
2010-02-17  0:33     ` John W. Linville

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=1266117186.13902.21.camel@mj \
    --to=proski@gnu.org \
    --cc=buytenh@marvell.com \
    --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).