Skip to contentSkip to conversation

nvmet-tcp: fix nvme tcp ida memory leak

PATCH Applied Guixin Liu 4 participants 4 messages Jan 26, 2024

Subsystems (2)
lore
Share & tools
lore

Guixin Liu

author
#0 lore raw

PATCH 1/1 nvmet-tcp: fix nvme tcp ida memory leak

The nvmet_tcp_queue_ida should be destroy when the nvmet-tcp module exit.

---
 drivers/nvme/target/tcp.c | 1 +
 1 file changed, 1 insertion(+)
drivers/nvme/target/tcp.c +1 -0
index 6a1e6bb80062..6b6062883b8e 100644
@@ -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);
Signature · 1 line
2.43.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 13 lines · Guixin Liu

The nvmet_tcp_queue_ida should be destroy when the nvmet-tcp module exit.

---
  drivers/nvme/target/tcp.c | 1 +
  1 file changed, 1 insertion(+)
drivers/nvme/target/tcp.c +0 -0
index 6a1e6bb80062..6b6062883b8e 100644

drivers/nvme/target/tcp.c static void __exit nvmet_tcp_exit(void) · line 2222

Quoted 7 lines
drivers/nvme/target/tcp.c +1 -0
@@ -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);

Looks good.

-ck

maintainer Applied
#3 lore raw
In reply to Guixin Liu
Quoted 2 lines · Guixin Liu

The nvmet_tcp_queue_ida should be destroy when the nvmet-tcp module exit.

Thanks, applied to nvme-6.8.