]> git.baikalelectronics.ru Git - kernel.git/commit
memstick/ms_block: Fix a memory leak
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sat, 25 Jun 2022 12:55:56 +0000 (14:55 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Aug 2022 09:17:55 +0000 (11:17 +0200)
commitfc3e30bce12e3592a65eca340350050402aa2f51
tree46f044197b7761e5c2468ef8c6ef1c385fdfcea5
parent7a11e277c7289c43578d7dda041bab5b1f96c308
memstick/ms_block: Fix a memory leak

[ Upstream commit c768972af4ad03995dd6c0877b08f98bc601dc10 ]

'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: f5fd04826d7e ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/memstick/core/ms_block.c