mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-27 23:25:13 -04:00
fjes: cancel force_close_task in fjes_remove()
force_close_task runs on the system workqueue, which destroy_workqueue() does not drain, so it can run after free_netdev() and touch freed memory. Cancel it after destroying the workqueues, before free_netdev(). This issue was found by an in-house static analysis tool. Cc: stable+noautosel@kernel.org # untested fix to a driver init path race Signed-off-by: Fan Wu <fanwu01@zju.edu.cn> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20260805012337.416908-1-fanwu01@zju.edu.cn Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
@@ -1402,6 +1402,8 @@ static void fjes_remove(struct platform_device *plat_dev)
|
||||
if (adapter->txrx_wq)
|
||||
destroy_workqueue(adapter->txrx_wq);
|
||||
|
||||
cancel_work_sync(&adapter->force_close_task);
|
||||
|
||||
fjes_hw_exit(hw);
|
||||
|
||||
netif_napi_del(&adapter->napi);
|
||||
|
||||
Reference in New Issue
Block a user