nvmet-tcp: fix nvme tcp ida memory leak
authorGuixin Liu <kanie@linux.alibaba.com>
Fri, 26 Jan 2024 08:26:43 +0000 (16:26 +0800)
committerKeith Busch <kbusch@kernel.org>
Fri, 26 Jan 2024 17:16:34 +0000 (09:16 -0800)
The nvmet_tcp_queue_ida should be destroy when the nvmet-tcp module
exit.

Signed-off-by: Guixin Liu <kanie@linux.alibaba.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
drivers/nvme/target/tcp.c

index da0469978d6f446265b79817b01d58ac02d6758e..c8655fc5aa5b8aac838cb4c2e4c0a76c8ebbc174 100644 (file)
@@ -2216,6 +2216,7 @@ static void __exit nvmet_tcp_exit(void)
        flush_workqueue(nvmet_wq);
 
        destroy_workqueue(nvmet_tcp_wq);
+       ida_destroy(&nvmet_tcp_queue_ida);
 }
 
 module_init(nvmet_tcp_init);