[PATCH v2] nvmet-tcp: check return value of nvmet_tcp_set_queue_sock
Chaitanya Kulkarni
chaitanyak at nvidia.com
Tue May 26 10:05:03 PDT 2026
On 5/26/26 02:28, Geliang Tang wrote:
> From: Geliang Tang<tanggeliang at kylinos.cn>
>
> The return value of nvmet_tcp_set_queue_sock() is currently ignored in
> nvmet_tcp_tls_handshake_done(). If it fails (e.g., due to the socket
> not being in TCP_ESTABLISHED state), the socket callbacks will not be
> properly set, leading to queue and socket leakage.
>
> Fix this by capturing the return value and calling
> nvmet_tcp_schedule_release_queue() on failure to ensure proper cleanup.
>
> Fixes: 675b453e0241 ("nvmet-tcp: enable TLS handshake upcall")
> Reviewed-by: Hannes Reinecke<hare at kernel.org>
> Signed-off-by: Geliang Tang<tanggeliang at kylinos.cn>
Looks good.
Reviewed-by: Chaitanya Kulkarni <kch at nvidia.com>
-ck
More information about the Linux-nvme
mailing list