Skip to content

Commit

Permalink
kcm: Destroy mutex in kcm_exit_net()
Browse files Browse the repository at this point in the history
kcm_exit_net() should call mutex_destroy() on knet->mutex. This is especially
needed if CONFIG_DEBUG_MUTEXES is enabled.

Fixes: ab7ac4e ("kcm: Kernel Connection Multiplexor module")
Signed-off-by: Shigeru Yoshida <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Paolo Abeni <[email protected]>
  • Loading branch information
Shigeru Yoshida authored and Paolo Abeni committed Sep 5, 2023
1 parent 8fc134f commit 6ad40b3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/kcm/kcmsock.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit 6ad40b3

Please sign in to comment.