Skip to contentSkip to conversation

kcm: Destroy mutex in kcm_exit_net()

PATCH Applied Shigeru Yoshida 2 participants 2 messages Sep 2, 2023 – Sep 5, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kcm: Destroy mutex in kcm_exit_net()

kcm_exit_net() should call mutex_destroy() on knet->mutex. This is especially needed if CONFIG_DEBUG_MUTEXES is enabled.

Fixes ab7ac4eb9832 ("kcm: Kernel Connection Multiplexor module")
---
 net/kcm/kcmsock.c | 2 ++
 1 file changed, 2 insertions(+)
net/kcm/kcmsock.c +2 -0
index 393f01b2a7e6..4580f61426bb 100644
@@ -1859,6 +1859,8 @@ static __net_exit void kcm_exit_net(struct net *net)
 	 * that all multiplexors and psocks have been destroyed.
 	 */
 	WARN_ON(!list_empty(&knet->mux_list));
+
+	mutex_destroy(&knet->mutex);
 }
 
 static struct pernet_operations kcm_net_ops = {
Signature · 1 line
2.41.0
#1 lore raw
This patch was applied to netdev/net.git (main) by Paolo Abeni <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by Paolo Abeni <[email protected]>:

Quoted 8 lines · On Sun, 3 Sep 2023 02:07:08 +0900 you wrote:

kcm_exit_net() should call mutex_destroy() on knet->mutex. This is especially needed if CONFIG_DEBUG_MUTEXES is enabled.

Fixes ab7ac4eb9832 ("kcm: Kernel Connection Multiplexor module")
---
 net/kcm/kcmsock.c | 2 ++
 1 file changed, 2 insertions(+)

Here is the summary with links:
- [net] kcm: Destroy mutex in kcm_exit_net()

    https://git.kernel.org/netdev/net/c/6ad40b36cd3b

You are awesome, thank you!

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