aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAlban Browaeys <prahal@yahoo.com>2009-12-04 23:46:57 +0100
committerJohn W. Linville <linville@tuxdriver.com>2009-12-21 18:56:23 -0500
commitc70762f9acad654002704f1e53436a0ba3356c31 (patch)
tree805a613a3bb7622d42176471b437ce600960039f /drivers
parent050e8a47dc8b056c880f380ffd01055669f8fe68 (diff)
rt2x00 : bail out of regbusy_read if device is removed.
platform rfkill is async thus we may try to read while the device is already off. Signed-off-by: Alban Browaeys <prahal@yahoo.com> Acked-by: Gertjan van Wingerde <gwingerde@gmail.com> Acked-by: Ivo van Doorn <ivdoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00pci.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00pci.c b/drivers/net/wireless/rt2x00/rt2x00pci.c
index 0feb4d0e466..801be436cf1 100644
--- a/drivers/net/wireless/rt2x00/rt2x00pci.c
+++ b/drivers/net/wireless/rt2x00/rt2x00pci.c
@@ -41,6 +41,9 @@ int rt2x00pci_regbusy_read(struct rt2x00_dev *rt2x00dev,
{
unsigned int i;
+ if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags))
+ return 0;
+
for (i = 0; i < REGISTER_BUSY_COUNT; i++) {
rt2x00pci_register_read(rt2x00dev, offset, reg);
if (!rt2x00_get_field32(*reg, field))