[PATCH] nvme/tcp: pair send_mutex init with destroy

Keith Busch kbusch at kernel.org
Fri Aug 6 08:41:43 PDT 2021


Each mutex_init() should have a corresponding mutex_destroy().

Signed-off-by: Keith Busch <kbusch at kernel.org>
---
 drivers/nvme/host/tcp.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c
index 8cb15ee5b249..b7a5e5e289dc 100644
--- a/drivers/nvme/host/tcp.c
+++ b/drivers/nvme/host/tcp.c
@@ -1228,6 +1228,7 @@ static void nvme_tcp_free_queue(struct nvme_ctrl *nctrl, int qid)
 
 	sock_release(queue->sock);
 	kfree(queue->pdu);
+	mutex_destroy(&queue->send_mutex);
 	mutex_destroy(&queue->queue_lock);
 }
 
@@ -1533,6 +1534,7 @@ static int nvme_tcp_alloc_queue(struct nvme_ctrl *nctrl,
 	sock_release(queue->sock);
 	queue->sock = NULL;
 err_destroy_mutex:
+	mutex_destroy(&queue->send_mutex);
 	mutex_destroy(&queue->queue_lock);
 	return ret;
 }
-- 
2.25.4




More information about the Linux-nvme mailing list