Skip to contentSkip to conversation

amt: cancel delayed_work synchronously in amt_fini()

PATCH Applied Taehee Yoo 2 participants 2 messages Nov 16, 2021 – Nov 17, 2021

Subsystems (3)
lore
Share & tools
lore

Taehee Yoo

author maintainer
#0 lore raw

PATCH 1/1 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.

Fixes bc54e49c140b ("amt: add multicast(IGMP) report message handler")
---
 drivers/net/amt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/amt.c +1 -1
index 47a04c330885..b732ee9a50ef 100644
@@ -3286,7 +3286,7 @@ static void __exit amt_fini(void)
 {
 	rtnl_link_unregister(&amt_link_ops);
 	unregister_netdevice_notifier(&amt_notifier_block);
-	cancel_delayed_work(&source_gc_wq);
+	cancel_delayed_work_sync(&source_gc_wq);
 	__amt_source_gc_work();
 	destroy_workqueue(amt_wq);
 }
Signature · 1 line
2.17.1
#1 lore raw
This patch was applied to netdev/net.git (master) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Tue, 16 Nov 2021 16:09:23 +0000 you wrote:

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.

[...]

Here is the summary with links:
- [net] amt: cancel delayed_work synchronously in amt_fini()

    https://git.kernel.org/netdev/net/c/b0024a04e488

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html