linux-stable/drivers/mtd
Xin Xiong fe0e2ce5c8 mtd: rawnand: atmel: fix refcount issue in atmel_nand_controller_init
[ Upstream commit fecbd4a317 ]

The reference counting issue happens in several error handling paths
on a refcounted object "nc->dmac". In these paths, the function simply
returns the error code, forgetting to balance the reference count of
"nc->dmac", increased earlier by dma_request_channel(), which may
cause refcount leaks.

Fix it by decrementing the refcount of specific object in those error
paths.

Fixes: f88fc122cc ("mtd: nand: Cleanup/rework the atmel_nand driver")
Co-developed-by: Xiyu Yang <xiyuyang19@fudan.edu.cn>
Signed-off-by: Xiyu Yang <xiyuyang19@fudan.edu.cn>
Co-developed-by: Xin Tan <tanxin.ctf@gmail.com>
Signed-off-by: Xin Tan <tanxin.ctf@gmail.com>
Signed-off-by: Xin Xiong <xiongx18@fudan.edu.cn>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20220304085330.3610-1-xiongx18@fudan.edu.cn
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-04-08 14:23:39 +02:00
..
chips mtd: fixup CFI on ixp4xx 2022-01-20 09:13:16 +01:00
devices mtd: mchp48l640: Add SPI ID table 2022-04-08 14:23:29 +02:00
hyperbus mtd: hyperbus: rpc-if: fix bug in rpcif_hb_remove 2022-01-27 11:03:15 +01:00
lpddr
maps mtd: fixup CFI on ixp4xx 2022-01-20 09:13:16 +01:00
nand mtd: rawnand: atmel: fix refcount issue in atmel_nand_controller_init 2022-04-08 14:23:39 +02:00
parsers mtd: parsers: qcom: Fix missing free for pparts in cleanup 2022-02-23 12:03:16 +01:00
spi-nor mtd: spi-nor: Fix mtd size for s3an flashes 2022-03-08 19:12:33 +01:00
tests
ubi
ftl.c
inftlcore.c
inftlmount.c
Kconfig
Makefile
mtd_blkdevs.c
mtdblock.c
mtdblock_ro.c
mtdchar.c
mtdconcat.c
mtdcore.c mtd: core: Fix a conflict between MTD and NVMEM on wp-gpios property 2022-03-02 11:48:07 +01:00
mtdcore.h
mtdoops.c
mtdpart.c mtd: Fixed breaking list in __mtd_del_partition. 2022-01-27 11:02:48 +01:00
mtdpstore.c
mtdsuper.c
mtdswap.c
nftlcore.c
nftlmount.c
rfd_ftl.c
sm_ftl.c
sm_ftl.h
ssfdc.c