Skip to content

Commit

Permalink
b43: Fix possible MMIO access while device is down
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Michael Buesch authored and John W. Linville committed Jun 25, 2008
1 parent 664f200 commit 7b3abfc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/wireless/b43/leds.c
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down

0 comments on commit 7b3abfc

Please sign in to comment.