ksmbd: Fix potential memory leak in tcp_destroy_socket()

ksmbd_socket must be freed even if kernel_sock_shutdown() somehow fails.

Signed-off-by: Marios Makassikis <mmakassikis@freebox.fr>
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
This commit is contained in:
Marios Makassikis 2021-07-23 12:58:41 +09:00 committed by Namjae Jeon
parent 378087cd17
commit 654c8876f9
1 changed files with 1 additions and 2 deletions

View File

@ -381,7 +381,6 @@ static void tcp_destroy_socket(struct socket *ksmbd_socket)
ret = kernel_sock_shutdown(ksmbd_socket, SHUT_RDWR);
if (ret)
pr_err("Failed to shutdown socket: %d\n", ret);
else
sock_release(ksmbd_socket);
}