Преглед изворни кода

ath5k: read sc->imask with sc->irqlock held

Signed-off-by: Pavel Roskin <proski@gnu.org>

sc->imask may change if ath5k_set_current_imask() races against itself.
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Pavel Roskin пре 14 година
родитељ
комит
4fc5401c14
1 измењених фајлова са 2 додато и 1 уклоњено
  1. 2 1
      drivers/net/wireless/ath/ath5k/base.c

+ 2 - 1
drivers/net/wireless/ath/ath5k/base.c

@@ -1447,10 +1447,11 @@ ath5k_receive_frame_ok(struct ath5k_softc *sc, struct ath5k_rx_status *rs)
 static void
 static void
 ath5k_set_current_imask(struct ath5k_softc *sc)
 ath5k_set_current_imask(struct ath5k_softc *sc)
 {
 {
-	enum ath5k_int imask = sc->imask;
+	enum ath5k_int imask;
 	unsigned long flags;
 	unsigned long flags;
 
 
 	spin_lock_irqsave(&sc->irqlock, flags);
 	spin_lock_irqsave(&sc->irqlock, flags);
+	imask = sc->imask;
 	if (sc->rx_pending)
 	if (sc->rx_pending)
 		imask &= ~AR5K_INT_RX_ALL;
 		imask &= ~AR5K_INT_RX_ALL;
 	if (sc->tx_pending)
 	if (sc->tx_pending)