mwifiex: cancel pcie/sdio work in remove/shutdown handler

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>
This commit is contained in:
Xinming Hu 2017-12-13 19:27:53 +08:00 committed by Kalle Valo
parent 18d6050133
commit b713bbf147
2 changed files with 4 additions and 0 deletions

View 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);
}

View 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);
}