aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath5k
diff options
context:
space:
mode:
authorBob Copeland <me@bobcopeland.com>2009-02-15 12:06:10 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-02-27 14:52:36 -0500
commitb5f03956c56d72ad336e5c2c42a025f25d952c30 (patch)
tree09845f1ce873035df975b327483608525379cccb /drivers/net/wireless/ath5k
parent0b6f582bd38783e14f67d4466923f587728b2438 (diff)
ath5k: use spin_lock_irqsave for beacon lock
ath5k_reset can be called from process context, which in turn can call ath5k_beacon_config which takes the sc->block spinlock. Since it can also be taken in hard irq context, use spin_lock_irqsave everywhere. This fixes a potential deadlock in adhoc mode. Changes-licensed-under: 3-Clause-BSD Cc: stable@kernel.org Signed-off-by: Bob Copeland <me@bobcopeland.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath5k')
-rw-r--r--drivers/net/wireless/ath5k/base.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/wireless/ath5k/base.c b/drivers/net/wireless/ath5k/base.c
index d930c10a7e52..8e5620afd2f9 100644
--- a/drivers/net/wireless/ath5k/base.c
+++ b/drivers/net/wireless/ath5k/base.c
@@ -1700,7 +1700,6 @@ ath5k_check_ibss_tsf(struct ath5k_softc *sc, struct sk_buff *skb,
1700 } 1700 }
1701} 1701}
1702 1702
1703
1704static void 1703static void
1705ath5k_tasklet_rx(unsigned long data) 1704ath5k_tasklet_rx(unsigned long data)
1706{ 1705{
@@ -2216,6 +2215,7 @@ static void
2216ath5k_beacon_config(struct ath5k_softc *sc) 2215ath5k_beacon_config(struct ath5k_softc *sc)
2217{ 2216{
2218 struct ath5k_hw *ah = sc->ah; 2217 struct ath5k_hw *ah = sc->ah;
2218 unsigned long flags;
2219 2219
2220 ath5k_hw_set_imr(ah, 0); 2220 ath5k_hw_set_imr(ah, 0);
2221 sc->bmisscount = 0; 2221 sc->bmisscount = 0;
@@ -2237,9 +2237,9 @@ ath5k_beacon_config(struct ath5k_softc *sc)
2237 2237
2238 if (sc->opmode == NL80211_IFTYPE_ADHOC) { 2238 if (sc->opmode == NL80211_IFTYPE_ADHOC) {
2239 if (ath5k_hw_hasveol(ah)) { 2239 if (ath5k_hw_hasveol(ah)) {
2240 spin_lock(&sc->block); 2240 spin_lock_irqsave(&sc->block, flags);
2241 ath5k_beacon_send(sc); 2241 ath5k_beacon_send(sc);
2242 spin_unlock(&sc->block); 2242 spin_unlock_irqrestore(&sc->block, flags);
2243 } 2243 }
2244 } else 2244 } else
2245 ath5k_beacon_update_timers(sc, -1); 2245 ath5k_beacon_update_timers(sc, -1);