Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

amt: cancel delayed_work synchronously in amt_fini()

When the amt module is being removed, it calls cancel_delayed_work()
to cancel pending delayed_work. But this function doesn't wait for
canceling delayed_work.
So, workers can be still doing after module delete.

In order to avoid this, cancel_delayed_work_sync() should be used instead.

Suggested-by: Jakub Kicinski <kuba@kernel.org>
Fixes: bc54e49c140b ("amt: add multicast(IGMP) report message handler")
Signed-off-by: Taehee Yoo <ap420073@gmail.com>
Link: https://lore.kernel.org/r/20211116160923.25258-1-ap420073@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Taehee Yoo and committed by
Jakub Kicinski
b0024a04 0a83f96f

+1 -1
+1 -1
drivers/net/amt.c
··· 3286 3286 { 3287 3287 rtnl_link_unregister(&amt_link_ops); 3288 3288 unregister_netdevice_notifier(&amt_notifier_block); 3289 - cancel_delayed_work(&source_gc_wq); 3289 + cancel_delayed_work_sync(&source_gc_wq); 3290 3290 __amt_source_gc_work(); 3291 3291 destroy_workqueue(amt_wq); 3292 3292 }