From: Michael Buesch Date: Thu, 3 Jul 2008 00:04:33 +0000 (+0200) Subject: b43: Fix possible MMIO access while device is down X-Git-Tag: v2.6.25.12~46 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=204b304df21a73cce2210eae236de6caaf3bc09b;p=thirdparty%2Fkernel%2Fstable.git b43: Fix possible MMIO access while device is down 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. Upstream commit is 33598cf261e393f2b3349cb55509e358014bfd1f Signed-off-by: Michael Buesch Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/net/wireless/b43/leds.c b/drivers/net/wireless/b43/leds.c index 0aac1ff511df7..23d4c095f5e70 100644 --- a/drivers/net/wireless/b43/leds.c +++ b/drivers/net/wireless/b43/leds.c @@ -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. */