linux-stable/drivers/mtd/nand/raw
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
..
atmel mtd: rawnand: atmel: fix refcount issue in atmel_nand_controller_init 2022-04-08 14:23:39 +02:00
bcm47xxnflash
brcmnand mtd: rawnand: brcmnand: Fixed incorrect sub-page ECC status 2022-02-23 12:03:16 +01:00
gpmi-nand mtd: rawnand: gpmi: fix controller timings setting 2022-04-08 14:23:25 +02:00
ingenic mtd: rawnand: ingenic: Fix missing put_device in ingenic_ecc_get 2022-02-23 12:03:16 +01:00
ams-delta.c mtd: rawnand: ams-delta: Keep the driver compatible with on-die ECC engines 2021-11-18 19:17:18 +01:00
arasan-nand-controller.c mtd: rawnand: arasan: Prevent an unsupported configuration 2021-11-18 19:17:01 +01:00
au1550nd.c mtd: rawnand: au1550nd: Keep the driver compatible with on-die ECC engines 2021-11-18 19:17:19 +01:00
cadence-nand-controller.c mtd: rawnand: Use more recent ONFI specification wording 2021-05-26 10:43:40 +02:00
cafe_nand.c mtd: rawnand: cafe: Fix a resource leak in the error handling path of 'cafe_nand_probe()' 2021-08-23 10:58:14 +02:00
cs553x_nand.c mtd: rawnand: cs553x: Fix external use of SW Hamming ECC helper 2021-05-10 18:34:13 +02:00
davinci_nand.c mtd: rawnand: Export nand_read_page_hwecc_oob_first() 2022-01-27 11:02:49 +01:00
denali.c
denali.h
denali_dt.c
denali_pci.c
diskonchip.c
fsl_elbc_nand.c
fsl_ifc_nand.c
fsl_upm.c
fsmc_nand.c mtd: rawnand: fsmc: Fix timing computation 2021-12-14 10:57:18 +01:00
gpio.c mtd: rawnand: gpio: Keep the driver compatible with on-die ECC engines 2021-11-18 19:17:18 +01:00
hisi504_nand.c mtd: rawnand: hisi504: Remove redundant dev_err call in probe 2021-05-10 10:34:23 +02:00
intel-nand-controller.c mtd: rawnand: intel: Fix potential buffer overflow in probe 2021-11-18 19:16:58 +01:00
internals.h mtd: rawnand: Choose the best timings, NV-DDR included 2021-05-26 10:52:43 +02:00
Kconfig mtd: rawnand: Fix a couple of spelling mistakes in Kconfig 2021-07-16 01:07:05 +02:00
lpc32xx_mlc.c
lpc32xx_slc.c mtd: rawnand: lpc32xx_slc: Fix external use of SW Hamming ECC helper 2021-05-10 18:34:29 +02:00
Makefile mtd: rawnand: pl353: Add support for the ARM PL353 SMC NAND controller 2021-06-18 09:45:21 +02:00
marvell_nand.c mtd: rawnand: marvell: Minor documentation correction 2021-06-18 09:45:21 +02:00
meson_nand.c mtd: rawnand: remove never changed ret variable 2021-08-06 22:01:56 +02:00
mpc5121_nfc.c mtd: rawnand: mpc5121: Remove unused variable in ads5121_select_chip() 2022-02-01 17:27:16 +01:00
mtk_ecc.c mtd: rawnand: mtk: remove redundant dev_err call in mtk_ecc_probe() 2021-05-10 10:34:41 +02:00
mtk_ecc.h
mtk_nand.c
mxc_nand.c mtd: rawnand: mxc: Remove unneeded of_match_ptr() 2021-03-28 19:13:39 +02:00
mxic_nand.c
nand_amd.c
nand_base.c mtd: rawnand: protect access to rawnand devices while in suspend 2022-04-08 14:22:53 +02:00
nand_bbt.c mtd: rawnand: nand_bbt: Skip bad blocks when searching for the BBT in NAND 2021-07-16 01:06:22 +02:00
nand_esmt.c
nand_hynix.c
nand_ids.c
nand_jedec.c
nand_legacy.c mtd: rawnand: Avoid accessing NV-DDR timings from legacy code 2021-05-26 10:43:52 +02:00
nand_macronix.c
nand_micron.c
nand_onfi.c mtd: rawnand: onfi: Fix endianness when reading NV-DDR values 2021-06-18 09:45:20 +02:00
nand_samsung.c
nand_timings.c mtd: rawnand: Add a helper to find the closest ONFI NV-DDR mode 2021-05-26 10:43:59 +02:00
nand_toshiba.c
nandsim.c
ndfc.c mtd: rawnand: ndfc: Fix external use of SW Hamming ECC helper 2021-05-10 18:34:29 +02:00
omap2.c mtd: rawnand: omap: Fix kernel doc warning on 'calcuate' typo 2021-08-06 22:01:56 +02:00
omap_elm.c mtd: rawnand: omap: Add larger page NAND chips support 2021-06-18 09:45:21 +02:00
orion_nand.c mtd: rawnand: orion: Keep the driver compatible with on-die ECC engines 2021-11-18 19:17:19 +01:00
oxnas_nand.c
pasemi_nand.c mtd: rawnand: pasemi: Keep the driver compatible with on-die ECC engines 2021-11-18 19:17:18 +01:00
pl35x-nand-controller.c mtd: rawnand: pl353: Set the nand chip node as the flash node 2022-04-08 14:23:32 +02:00
plat_nand.c mtd: rawnand: plat_nand: Keep the driver compatible with on-die ECC engines 2021-11-18 19:17:19 +01:00
qcom_nandc.c mtd: rawnand: qcom: Fix clock sequencing in qcom_nandc_probe() 2022-02-23 12:03:16 +01:00
r852.c mtd: rawnand: r852: use DEVICE_ATTR_RO() helper macro 2021-06-18 09:45:21 +02:00
r852.h
rockchip-nand-controller.c mtd: rawnand: rockchip: Use flexible-array member instead of zero-length array 2021-03-28 19:13:39 +02:00
s3c2410.c
sh_flctl.c
sharpsl.c mtd: rawnand: sharpsl: Fix external use of SW Hamming ECC helper 2021-05-10 18:34:30 +02:00
sm_common.c
sm_common.h
socrates_nand.c mtd: rawnand: socrates: Keep the driver compatible with on-die ECC engines 2021-11-18 19:16:02 +01:00
stm32_fmc2_nand.c
sunxi_nand.c mtd: rawnand: sunxi: remove unnecessary oom message 2021-06-11 20:43:33 +02:00
tegra_nand.c
tmio_nand.c mtd: rawnand: tmio: Fix external use of SW Hamming ECC helper 2021-05-10 18:34:30 +02:00
txx9ndfmc.c mtd: rawnand: txx9ndfmc: Fix external use of SW Hamming ECC helper 2021-05-10 18:34:30 +02:00
vf610_nfc.c
xway_nand.c mtd: rawnand: xway: Keep the driver compatible with on-die ECC engines 2021-11-18 19:17:18 +01:00