[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPDyKFr2VpKVtFhNYPjy+uXKRNVTXS6LaMoAkv8u9YDeXTnnBQ@mail.gmail.com>
Date: Tue, 12 Jul 2022 13:08:53 +0200
From: Ulf Hansson <ulf.hansson@...aro.org>
To: Christophe JAILLET <christophe.jaillet@...adoo.fr>
Cc: Maxim Levitsky <maximlevitsky@...il.com>,
Alex Dubov <oakad@...oo.com>,
Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org,
linux-mmc@...r.kernel.org
Subject: Re: [PATCH 2/3] memstick/ms_block: Fix a memory leak
On Sat, 25 Jun 2022 at 14:55, Christophe JAILLET
<christophe.jaillet@...adoo.fr> wrote:
>
> 'erased_blocks_bitmap' is never freed. As it is allocated at the same time
> as 'used_blocks_bitmap', it is likely that it should be freed also at the
> same time.
>
> Add the corresponding bitmap_free() in msb_data_clear().
>
> Fixes: 0ab30494bc4f ("memstick: add support for legacy memorysticks")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
Applied for next, thanks!
Kind regards
Uffe
> ---
> This patch is speculative.
> ---
> drivers/memstick/core/ms_block.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/memstick/core/ms_block.c b/drivers/memstick/core/ms_block.c
> index f8f151163667..f8fdf88fb240 100644
> --- a/drivers/memstick/core/ms_block.c
> +++ b/drivers/memstick/core/ms_block.c
> @@ -1947,6 +1947,7 @@ static void msb_data_clear(struct msb_data *msb)
> {
> kfree(msb->boot_page);
> bitmap_free(msb->used_blocks_bitmap);
> + bitmap_free(msb->erased_blocks_bitmap);
> kfree(msb->lba_to_pba_table);
> kfree(msb->cache);
> msb->card = NULL;
> --
> 2.34.1
>
Powered by blists - more mailing lists