Skip to content

Commit

Permalink
wlcore: check wl->state before setting default key
Browse files Browse the repository at this point in the history
wl1271_op_set_default_key_idx() lacks a check
of wl->state, causing the driver to try writing
to a powered-off device in some cases (e.g.
during recovery)

Signed-off-by: Eliad Peller <eliad@wizery.com>
  • Loading branch information
elp committed Sep 9, 2012
1 parent 023e474 commit 4c8af07
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/net/wireless/ti/wlcore/main.c
Expand Up @@ -3283,6 +3283,11 @@ static int wl1271_op_set_default_key_idx(struct ieee80211_hw *hw,

mutex_lock(&wl->mutex);

if (unlikely(wl->state != WLCORE_STATE_ON)) {
ret = -EAGAIN;
goto out_unlock;
}

ret = wl1271_ps_elp_wakeup(wl);
if (ret < 0)
goto out_unlock;
Expand Down

0 comments on commit 4c8af07

Please sign in to comment.