scsi: sd: fix sd ida memory leak
PATCH 1/1 scsi: sd: fix sd ida memory leak
The sd_index_ida should be destroy when the sd module exit.
Signed-off-by Guixin Liu <[email protected]>
--- drivers/scsi/sd.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/scsi/sd.c +2 -0
@@ -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);
Signature · 1 line
2.43.0
Quoted 12 lines · Guixin Liu
The
sd_index_idashould be destroy when the sd module exit.Signed-off-by Guixin Liu <[email protected]>--- drivers/scsi/sd.c | 2 ++ 1 file changed, 2 insertions(+)drivers/scsi/sd.c +0
-0
drivers/scsi/sd.c static void __exit exit_sd(void) · line 4083
Quoted 5 lines
drivers/scsi/sd.c +2
-0@@ -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);
Looks good to me.
Reviewed-by Benjamin Block <[email protected]>
Signature · 4 lines
Best Regards, Benjamin Block / Linux on IBM Z Kernel Development IBM Deutschland Research & Development GmbH / https://www.ibm.com/privacy Vors. Aufs.-R.: Wolfgang Wendt / Geschäftsführung: David Faller Sitz der Ges.: Böblingen / Registergericht: AmtsG Stuttgart, HRB 243294