summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShigeru Yoshida <syoshida@redhat.com>2023-09-03 02:07:08 +0900
committerPaolo Abeni <pabeni@redhat.com>2023-09-05 10:12:03 +0200
commit6ad40b36cd3b04209e2d6c89d252c873d8082a59 (patch)
treee916c23eec8e9d849b100c06dcd7b348e3b2eb68
parent8fc134fee27f2263988ae38920bc03da416b03d8 (diff)
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") Signed-off-by: Shigeru Yoshida <syoshida@redhat.com> Link: https://lore.kernel.org/r/20230902170708.1727999-1-syoshida@redhat.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
-rw-r--r--net/kcm/kcmsock.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/kcm/kcmsock.c b/net/kcm/kcmsock.c
index 393f01b2a7e6..4580f61426bb 100644
--- a/net/kcm/kcmsock.c
+++ b/net/kcm/kcmsock.c
@@ -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 = {