提交 654c8876 编写于 作者: M Marios Makassikis 提交者: 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: NMarios Makassikis <mmakassikis@freebox.fr>
Signed-off-by: NNamjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: NSteve French <stfrench@microsoft.com>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册