]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
b43: Fix possible MMIO access while device is down
authorMichael Buesch <mb@bu3sch.de>
Sun, 15 Jun 2008 14:01:24 +0000 (16:01 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 25 Jun 2008 14:55:09 +0000 (10:55 -0400)
This fixes a possible MMIO access while the device is still down
from a suspend cycle. MMIO accesses with the device powered down
may cause crashes on certain devices.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/b43/leds.c

index 36a9c42df835c3fa77241533cf90f1eb6c14e9e4..76f4c7bad8b83e52b30000ccc62f86a77113e45b 100644 (file)
@@ -72,6 +72,9 @@ static void b43_led_brightness_set(struct led_classdev *led_dev,
        struct b43_wldev *dev = led->dev;
        bool radio_enabled;
 
+       if (unlikely(b43_status(dev) < B43_STAT_INITIALIZED))
+               return;
+
        /* Checking the radio-enabled status here is slightly racy,
         * but we want to avoid the locking overhead and we don't care
         * whether the LED has the wrong state for a second. */