]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
mwifiex: cancel pcie/sdio work in remove/shutdown handler
authorXinming Hu <huxm@marvell.com>
Wed, 13 Dec 2017 11:27:53 +0000 (19:27 +0800)
committerKalle Valo <kvalo@codeaurora.org>
Mon, 8 Jan 2018 17:38:11 +0000 (19:38 +0200)
The last command used to shutdown firmware might be timeout,
and trigger firmware dump in asynchronous pcie/sdio work.

The remove/shutdown handler will continue free core data
structure private/adapter, which might be dereferenced in
pcie/sdio work, finally crash the kernel.

Sync and Cancel pcie/sdio work, could be a fix for above
cornel case. In this way, the last command timeout could
be handled properly.

Signed-off-by: Xinming Hu <huxm@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/marvell/mwifiex/pcie.c
drivers/net/wireless/marvell/mwifiex/sdio.c

index f666cb2ea7e03496cfe4dab4ddcd3f264fb8617b..23209c5cab05e86057359b4b9b6694307f7d67a5 100644 (file)
@@ -310,6 +310,8 @@ static void mwifiex_pcie_remove(struct pci_dev *pdev)
                mwifiex_init_shutdown_fw(priv, MWIFIEX_FUNC_SHUTDOWN);
        }
 
+       cancel_work_sync(&card->work);
+
        mwifiex_remove_card(adapter);
 }
 
index a82880132af409a79e0dd6076843e92ad7987bc7..248858723753d8bcca0ed53a751e981c84c0f45b 100644 (file)
@@ -399,6 +399,8 @@ mwifiex_sdio_remove(struct sdio_func *func)
                mwifiex_init_shutdown_fw(priv, MWIFIEX_FUNC_SHUTDOWN);
        }
 
+       cancel_work_sync(&card->work);
+
        mwifiex_remove_card(adapter);
 }