nvmet-tcp: do not try to cancel uninitialized tls_handshake_tmo_work
Subsystems (2)
PATCH v2 1/1 nvmet-tcp: do not try to cancel uninitialized tls_handshake_tmo_work
The TLS handshake timeout workqueue is only initialized if TLS is configured, so we shouldn't try to de-initialize it unconditionally.
Fixes 675b453e0241 ("nvmet-tcp: enable TLS handshake upcall")
Suggested-by Maurizio Lombardi <[email protected]>
Signed-off-by Hannes Reinecke <[email protected]>
--- drivers/nvme/target/tcp.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/nvme/target/tcp.c +2 -0
@@ -1587,7 +1587,9 @@ static void nvmet_tcp_release_queue_work(struct work_struct *w)mutex_unlock (&nvmet_tcp_queue_mutex);nvmet_tcp_restore_socket_callbacks (queue); +#ifdef CONFIG_NVME_TARGET_TCP_TLS cancel_delayed_work_sync (&queue->tls_handshake_tmo_work); +#endif cancel_work_sync (&queue->io_work);/* stop accepting incoming data */ queue->rcv_state =NVMET_TCP_RECV_ERR ;
Signature · 1 line
2.35.3
Jens Axboe
maintainerQuoted 3 lines · Hannes Reinecke
The TLS handshake timeout workqueue is only initialized if TLS is configured, so we shouldn't try to de-initialize it unconditionally.
Please fix this properly rather than working around it. Either put the work item inside CONFIG_NVME_TARGET_TCP_TLS so that any unintended use can't happen in the future, or just initialize the darn thing at setup time rather than have this conditional.
Signature · 1 line
Jens Axboe