public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: sd: fix sd ida memory leak
@ 2024-01-29  9:02 Guixin Liu
  2024-02-07 10:54 ` Benjamin Block
  0 siblings, 1 reply; 2+ messages in thread
From: Guixin Liu @ 2024-01-29  9:02 UTC (permalink / raw)
  To: jejb, martin.petersen; +Cc: linux-scsi

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 --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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] scsi: sd: fix sd ida memory leak
  2024-01-29  9:02 [PATCH] scsi: sd: fix sd ida memory leak Guixin Liu
@ 2024-02-07 10:54 ` Benjamin Block
  0 siblings, 0 replies; 2+ messages in thread
From: Benjamin Block @ 2024-02-07 10:54 UTC (permalink / raw)
  To: Guixin Liu; +Cc: jejb, martin.petersen, linux-scsi

On Mon, Jan 29, 2024 at 05:02:34PM +0800, Guixin Liu wrote:
> 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 --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);

Looks good to me.


Reviewed-by: Benjamin Block <bblock@linux.ibm.com>

-- 
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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-02-07 10:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-29  9:02 [PATCH] scsi: sd: fix sd ida memory leak Guixin Liu
2024-02-07 10:54 ` Benjamin Block

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox