]> git.proxmox.com Git - mirror_ubuntu-jammy-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)
committerStefan Bader <stefan.bader@canonical.com>
Mon, 17 Oct 2022 09:56:39 +0000 (11:56 +0200)
commit77e924cbd858087b208bee106525bc543e694242
tree89697dc1921cc90183df0de9fb03521f4862a734
parent5cf536a3186dc6157649e6727ac6faae3eecc3fb
memstick/ms_block: Fix a memory leak

BugLink: https://bugs.launchpad.net/bugs/1990162
[ Upstream commit 54eb7a55be6779c4d0c25eaf5056498a28595049 ]

'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@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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/memstick/core/ms_block.c