diff mbox series

scsi: sd: fix sd ida memory leak

Message ID 20240129090234.7762-1-kanie@linux.alibaba.com
State New
Headers show
Series scsi: sd: fix sd ida memory leak | expand

Commit Message

Guixin Liu Jan. 29, 2024, 9:02 a.m. UTC
The sd_index_ida should be destroy when the sd module exit.

Signed-off-by: Guixin Liu <kanie@linux.alibaba.com>
---
 drivers/scsi/sd.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 0833b3e6aa6e..8b88cba88da2 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -4079,6 +4079,8 @@  static void __exit exit_sd(void)
 
 	for (i = 0; i < SD_MAJORS; i++)
 		unregister_blkdev(sd_major(i), "sd");
+
+	ida_destroy(&sd_index_ida);
 }
 
 module_init(init_sd);