[PATCHv2] nvmet-tcp: do not try to cancel uninitialized tls_handshake_tmo_work
Hannes Reinecke
hare at suse.de
Thu Oct 19 06:34:17 PDT 2023
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 <mlombard at redhat.com>
Signed-off-by: Hannes Reinecke <hare at suse.de>
---
drivers/nvme/target/tcp.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/nvme/target/tcp.c b/drivers/nvme/target/tcp.c
index 4336fe048e43..e155bcaa42fa 100644
--- a/drivers/nvme/target/tcp.c
+++ b/drivers/nvme/target/tcp.c
@@ -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;
--
2.35.3
More information about the Linux-nvme
mailing list