b43: Protect sanity check against physical device removal
authorMichael Buesch <mb@bu3sch.de>
Fri, 2 Oct 2009 22:57:58 +0000 (00:57 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 7 Oct 2009 20:33:50 +0000 (16:33 -0400)
Fix IRQ mask sanity check for physically pulled device.

Tested-by: Andrew Price <andy@andrewprice.me.uk>
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/b43/main.c

index 130dcd5928b14e12363743b6a7a66b56950eecc3..86f35827f0085a19d01d94624c4f2aee3603df3f 100644 (file)
@@ -3874,6 +3874,7 @@ static struct b43_wldev * b43_wireless_core_stop(struct b43_wldev *dev)
 {
        struct b43_wl *wl = dev->wl;
        struct b43_wldev *orig_dev;
+       u32 mask;
 
 redo:
        if (!dev || b43_status(dev) < B43_STAT_STARTED)
@@ -3920,7 +3921,8 @@ redo:
                        goto redo;
                return dev;
        }
-       B43_WARN_ON(b43_read32(dev, B43_MMIO_GEN_IRQ_MASK));
+       mask = b43_read32(dev, B43_MMIO_GEN_IRQ_MASK);
+       B43_WARN_ON(mask != 0xFFFFFFFF && mask);
 
        /* Drain the TX queue */
        while (skb_queue_len(&wl->tx_queue))