diff options
author | Miquel Raynal <miquel.raynal@bootlin.com> | 2024-10-01 23:31:49 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-12-05 16:02:05 +0300 |
commit | 8ac19ec818c548c5788da5926dcc8af96fad4bb1 (patch) | |
tree | 1375b79c1daebebe3b0547b32c6e3b9b8035b04a /drivers/clk | |
parent | a9d27c6a178b6f4d27ae6c0b93ab87241abfec38 (diff) | |
download | linux-8ac19ec818c548c5788da5926dcc8af96fad4bb1.tar.xz |
mtd: rawnand: atmel: Fix possible memory leak
[ Upstream commit 6d734f1bfc336aaea91313a5632f2f197608fadd ]
The pmecc "user" structure is allocated in atmel_pmecc_create_user() and
was supposed to be freed with atmel_pmecc_destroy_user(), but this other
helper is never called. One solution would be to find the proper
location to call the destructor, but the trend today is to switch to
device managed allocations, which in this case fits pretty well.
Replace kzalloc() by devm_kzalloc() and drop the destructor entirely.
Reported-by: "Dr. David Alan Gilbert" <linux@treblig.org>
Closes: https://lore.kernel.org/all/ZvmIvRJCf6VhHvpo@gallifrey/
Fixes: f88fc122cc34 ("mtd: nand: Cleanup/rework the atmel_nand driver")
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20241001203149.387655-1-miquel.raynal@bootlin.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/clk')
0 files changed, 0 insertions, 0 deletions