Commit 654c8876 authored by Marios Makassikis's avatar Marios Makassikis Committed by Namjae Jeon

ksmbd: Fix potential memory leak in tcp_destroy_socket()

ksmbd_socket must be freed even if kernel_sock_shutdown() somehow fails.
Signed-off-by: default avatarMarios Makassikis <mmakassikis@freebox.fr>
Signed-off-by: default avatarNamjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent 378087cd
......@@ -381,8 +381,7 @@ 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);
sock_release(ksmbd_socket);
}
/**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment