]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
smb: server: fix leak of active_num_conn in ksmbd_tcp_new_connection()
authorHenrique Carvalho <henrique.carvalho@suse.com>
Wed, 4 Feb 2026 23:06:43 +0000 (20:06 -0300)
committerSteve French <stfrench@microsoft.com>
Mon, 9 Feb 2026 02:25:16 +0000 (20:25 -0600)
commit77ffbcac4e569566d0092d5f22627dfc0896b553
treea8bccdc477bdbc4919d965000c04dd6c7ed6c525
parentb38f99c1217ae04753340f0fdcd8f35bf56841dc
smb: server: fix leak of active_num_conn in ksmbd_tcp_new_connection()

On kthread_run() failure in ksmbd_tcp_new_connection(), the transport is
freed via free_transport(), which does not decrement active_num_conn,
leaking this counter.

Replace free_transport() with ksmbd_tcp_disconnect().

Fixes: 0d0d4680db22e ("ksmbd: add max connections parameter")
Cc: stable@vger.kernel.org
Signed-off-by: Henrique Carvalho <henrique.carvalho@suse.com>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/server/transport_tcp.c