zd1211rw: cancel process_intr work on zd_chip_disable_int()
authorJussi Kivilinna <jussi.kivilinna@mbnet.fi>
Mon, 31 Jan 2011 18:47:17 +0000 (20:47 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 4 Feb 2011 21:29:48 +0000 (16:29 -0500)
OOPS if worker is running and disconnect() is called (triggered
by unpluging device). Much harder to trigger at this stage but
later when we have AP beacon work in process_intr it happens very
easy.

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/zd1211rw/zd_chip.c

index 6a9b66051cf7de38000dcc20f3a2d944cef4ceae..b644ced848e7c89e638abaab0a5eaa44968edba7 100644 (file)
@@ -1407,6 +1407,9 @@ void zd_chip_disable_int(struct zd_chip *chip)
        mutex_lock(&chip->mutex);
        zd_usb_disable_int(&chip->usb);
        mutex_unlock(&chip->mutex);
+
+       /* cancel pending interrupt work */
+       cancel_work_sync(&zd_chip_to_mac(chip)->process_intr);
 }
 
 int zd_chip_enable_rxtx(struct zd_chip *chip)