Skip to content

Commit 54eb7a5

Browse files
tititiou36Ulf Hansson
authored andcommitted
memstick/ms_block: Fix a memory leak
'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: 0ab3049 ("memstick: add support for legacy memorysticks") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://lore.kernel.org/r/b3b78926569445962ea5c3b6e9102418a9effb88.1656155715.git.christophe.jaillet@wanadoo.fr Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
1 parent 2e531bc commit 54eb7a5

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

drivers/memstick/core/ms_block.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1947,6 +1947,7 @@ static void msb_data_clear(struct msb_data *msb)
19471947
{
19481948
kfree(msb->boot_page);
19491949
bitmap_free(msb->used_blocks_bitmap);
1950+
bitmap_free(msb->erased_blocks_bitmap);
19501951
kfree(msb->lba_to_pba_table);
19511952
kfree(msb->cache);
19521953
msb->card = NULL;

0 commit comments

Comments
 (0)