OSDN Git Service

nvme-tcp: pair send_mutex init with destroy
authorKeith Busch <kbusch@kernel.org>
Fri, 6 Aug 2021 15:41:43 +0000 (08:41 -0700)
committerChristoph Hellwig <hch@lst.de>
Mon, 16 Aug 2021 12:42:24 +0000 (14:42 +0200)
Each mutex_init() should have a corresponding mutex_destroy().

Signed-off-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/tcp.c

index 0a97ba0..95d4cf7 100644 (file)
@@ -1220,6 +1220,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);
 }
 
@@ -1525,6 +1526,7 @@ err_sock:
        sock_release(queue->sock);
        queue->sock = NULL;
 err_destroy_mutex:
+       mutex_destroy(&queue->send_mutex);
        mutex_destroy(&queue->queue_lock);
        return ret;
 }