kernel_samsung_a53x/drivers/mtd
Miquel Raynal a63261b061 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>
2024-12-17 13:24:08 +01:00
..
chips
devices Revert "mtd: slram: insert break after errors in parsing the map" 2024-11-24 00:23:27 +01:00
hyperbus
lpddr
maps mtd: maps: physmap-core: fix flash size larger than 32-bit 2024-11-19 08:44:54 +01:00
nand mtd: rawnand: atmel: Fix possible memory leak 2024-12-17 13:24:08 +01:00
parsers mtd: partitions: redboot: Added conversion of operands to a larger type 2024-11-19 14:19:32 +01:00
spi-nor
tests mtd: make mtd_test.c a separate module 2024-11-23 23:20:10 +01:00
ubi ubi: eba: properly rollback inside self_check_eba 2024-11-23 23:20:14 +01:00
ftl.c
inftlcore.c
inftlmount.c
Kconfig
Makefile
mtd_blkdevs.c
mtdblock.c
mtdblock_ro.c
mtdchar.c
mtdconcat.c
mtdcore.c
mtdcore.h
mtdoops.c
mtdpart.c
mtdpstore.c
mtdsuper.c
mtdswap.c
nftlcore.c
nftlmount.c
rfd_ftl.c
sm_ftl.c
sm_ftl.h
ssfdc.c