summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/wl12xx/wl1271_event.c
diff options
context:
space:
mode:
authorJuuso Oikarinen <juuso.oikarinen@nokia.com>2010-09-21 06:23:29 +0200
committerLuciano Coelho <luciano.coelho@nokia.com>2010-09-28 12:30:03 +0300
commit8c7f4f3166e16bb350bfc53955ea6cf9bfd34aab (patch)
treeec80e5620a4c54a50942049a7b4167b10813bbc9 /drivers/net/wireless/wl12xx/wl1271_event.c
parentc454f1d9a896d3519c756355b37bb39941093233 (diff)
wl1271: Fix work cancelling when shutting down the driver
The work cancelling has had several hazards, ranging from potentially executing work after the driver is in OFF state, to executing work after the driver and relevant memory structures are already removed. Fix these. Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com> Reviewed-by: Teemu Paasikivi <ext-teemu.3.paasikivi@nokia.com> Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Diffstat (limited to 'drivers/net/wireless/wl12xx/wl1271_event.c')
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_event.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_event.c b/drivers/net/wireless/wl12xx/wl1271_event.c
index bced8296a251..e6c839af9038 100644
--- a/drivers/net/wireless/wl12xx/wl1271_event.c
+++ b/drivers/net/wireless/wl12xx/wl1271_event.c
@@ -41,6 +41,9 @@ void wl1271_pspoll_work(struct work_struct *work)
mutex_lock(&wl->mutex);
+ if (unlikely(wl->state == WL1271_STATE_OFF))
+ goto out;
+
if (!test_and_clear_bit(WL1271_FLAG_PSPOLL_FAILURE, &wl->flags))
goto out;