[PATCH] nvmet-tcp: fix nvme tcp ida memory leak

Chaitanya Kulkarni chaitanyak at nvidia.com
Fri Jan 26 00:29:21 PST 2024


On 1/26/24 00:26, Guixin Liu wrote:
> The nvmet_tcp_queue_ida should be destroy when the nvmet-tcp module
> exit.
>
> Signed-off-by: Guixin Liu <kanie at linux.alibaba.com>
> ---
>   drivers/nvme/target/tcp.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/drivers/nvme/target/tcp.c b/drivers/nvme/target/tcp.c
> index 6a1e6bb80062..6b6062883b8e 100644
> --- a/drivers/nvme/target/tcp.c
> +++ b/drivers/nvme/target/tcp.c
> @@ -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.

Reviewed-by: Chaitanya Kulkarni <kch at nvidia.com>

-ck




More information about the Linux-nvme mailing list