Skip to content

Commit

Permalink
wl12xx: Make sure HW is available in sched scan ops
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Pontus Fuchs authored and Luciano Coelho committed Feb 15, 2012
1 parent 15944ae commit 9e0dc89
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/net/wireless/wl12xx/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 9e0dc89

Please sign in to comment.