The sd_index_ida should be destroy when the sd module exit. Signed-off-by: Guixin Liu <kanie@xxxxxxxxxxxxxxxxx> --- drivers/scsi/sd.c | 2 ++ 1 file changed, 2 insertions(+) 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); -- 2.43.0