summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorPontus Fuchs <pontus.fuchs@gmail.com>2012-01-11 13:22:42 (GMT)
committerLuciano Coelho <coelho@ti.com>2012-02-15 06:38:28 (GMT)
commit9e0dc890ce23e2b28ce906bb8f466ca66f420911 (patch)
treea3099c0de023bd1d17121e8733829594947459ac /drivers
parent15944aef29b6a3d96c52f3140c08b5a9d5fda0e9 (diff)
downloadlinux-fsl-qoriq-9e0dc890ce23e2b28ce906bb8f466ca66f420911.tar.xz
wl12xx: Make sure HW is available in sched scan ops
The sched_scan_(stop|start) ops fails to check for WL1271_STATE_OFF. This can lead to a race where the driver tries to access the HW while it's off. Fix this by checking for WL1271_STATE_OFF before accessing the HW. Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/wl12xx/main.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index f8748ce..f2a958c 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -3108,6 +3108,11 @@ static int wl1271_op_sched_scan_start(struct ieee80211_hw *hw,
mutex_lock(&wl->mutex);
+ if (wl->state == WL1271_STATE_OFF) {
+ ret = -EAGAIN;
+ goto out;
+ }
+
ret = wl1271_ps_elp_wakeup(wl);
if (ret < 0)
goto out;
@@ -3139,6 +3144,9 @@ static void wl1271_op_sched_scan_stop(struct ieee80211_hw *hw,
mutex_lock(&wl->mutex);
+ if (wl->state == WL1271_STATE_OFF)
+ goto out;
+
ret = wl1271_ps_elp_wakeup(wl);
if (ret < 0)
goto out;