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:
Fan Wu
2026-08-05 01:23:37 +00:00
committed by Jakub Kicinski
parent f2473fbfc3
commit c206fc0705

View File

@@ -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);