TencentOS-kernel/drivers/mtd/nand/raw
Lv Yunlong 35c0b473a6 mtd: rawnand: gpmi: Fix a double free in gpmi_nand_init
[ Upstream commit 076de75de1e53160e9b099f75872c1f9adf41a0b ]

If the callee gpmi_alloc_dma_buffer() failed to alloc memory for
this->raw_buffer, gpmi_free_dma_buffer() will be called to free
this->auxiliary_virt. But this->auxiliary_virt is still a non-NULL
and valid ptr.

Then gpmi_alloc_dma_buffer() returns err and gpmi_free_dma_buffer()
is called again to free this->auxiliary_virt in err_out. This causes
a double free.

As gpmi_free_dma_buffer() has already called in gpmi_alloc_dma_buffer's
error path, so it should return err directly instead of releasing the dma
buffer again.

Fixes: 4d02423e9afe6 ("mtd: nand: gpmi: Fix gpmi_nand_init() error path")
Signed-off-by: Lv Yunlong <lyl2019@mail.ustc.edu.cn>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20210403060905.5251-1-lyl2019@mail.ustc.edu.cn
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-05-20 16:07:48 +08:00
..
atmel mtd: rawnand: atmel: Update ecc_stats.corrected counter 2021-05-20 16:07:20 +08:00
bcm47xxnflash Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
brcmnand mtd: rawnand: brcmnand: fix OOB R/W with Hamming ECC 2021-05-20 16:07:45 +08:00
gpmi-nand mtd: rawnand: gpmi: Fix a double free in gpmi_nand_init 2021-05-20 16:07:48 +08:00
ingenic mtd: rawnand: ingenic: Fix the probe error path 2021-03-16 16:29:52 +08:00
Kconfig Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
Makefile Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
ams-delta.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
au1550nd.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
cafe_nand.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
cmx270_nand.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
cs553x_nand.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
davinci_nand.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
denali.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
denali.h Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
denali_dt.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
denali_pci.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
diskonchip.c mtd: rawnand: diskonchip: Fix the probe error path 2021-03-16 16:29:51 +08:00
fsl_elbc_nand.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
fsl_ifc_nand.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
fsl_upm.c mtd: rawnand: fsl_upm: Remove unused mtd var 2021-03-16 16:34:11 +08:00
fsmc_nand.c mtd: rawnand: fsmc: Fix error code in fsmc_nand_probe() 2021-05-20 16:07:45 +08:00
gpio.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
hisi504_nand.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
internals.h Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
lpc32xx_mlc.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
lpc32xx_slc.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
marvell_nand.c mtd: rawnand: marvell: Fix probe error path 2021-03-16 16:32:04 +08:00
meson_nand.c mtd: rawnand: meson: fix meson_nfc_dma_buffer_release() arguments 2021-03-16 16:43:41 +08:00
mpc5121_nfc.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
mtk_ecc.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
mtk_ecc.h Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
mtk_nand.c mtd: rawnand: mtk: Fix the probe error path 2021-03-16 16:29:53 +08:00
mxc_nand.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
mxic_nand.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
nand_amd.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
nand_base.c mtd: rawnand: Fix nand_gpio_waitrdy() 2021-03-16 16:29:51 +08:00
nand_bbt.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
nand_bch.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
nand_ecc.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
nand_esmt.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
nand_hynix.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
nand_ids.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
nand_jedec.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
nand_legacy.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
nand_macronix.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
nand_micron.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
nand_onfi.c mtd: rawnand: onfi: Fix redundancy detection check 2021-03-16 16:29:51 +08:00
nand_samsung.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
nand_timings.c mtd: rawnand: timings: Fix default tR_max and tCCS_min timings 2021-03-16 16:32:04 +08:00
nand_toshiba.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
nandsim.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
ndfc.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
omap2.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
omap_elm.c mtd: rawnand: omap_elm: Fix runtime PM imbalance on error 2021-03-16 16:37:24 +08:00
orion_nand.c mtd: rawnand: orion: Fix the probe error path 2021-03-16 16:29:52 +08:00
oxnas_nand.c mtd: rawnand: oxnas: Release all devices in the _remove() path 2021-03-16 16:32:05 +08:00
pasemi_nand.c mtd: rawnand: pasemi: Fix the probe error path 2021-03-16 16:29:53 +08:00
plat_nand.c mtd: rawnand: plat_nand: Fix the probe error path 2021-03-16 16:29:53 +08:00
qcom_nandc.c mtd: rawnand: qcom: Return actual error code instead of -ENODEV 2021-05-20 16:07:46 +08:00
r852.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
r852.h Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
s3c2410.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
sh_flctl.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
sharpsl.c mtd: rawnand: sharpsl: Fix the probe error path 2021-03-16 16:29:52 +08:00
sm_common.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
sm_common.h Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
socrates_nand.c mtd: rawnand: socrates: Fix the probe error path 2021-03-16 16:29:52 +08:00
stm32_fmc2_nand.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
sunxi_nand.c mtd: rawnand: sunxi: Fix the probe error path 2021-03-16 16:29:53 +08:00
tango_nand.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
tegra_nand.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
tmio_nand.c mtd: rawnand: tmio: Fix the probe error path 2021-03-16 16:29:53 +08:00
txx9ndfmc.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
vf610_nfc.c mtd: rawnand: vf610: disable clk on error handling path in probe 2021-03-16 16:38:55 +08:00
xway_nand.c mtd: rawnand: xway: Fix the probe error path 2021-03-16 16:29:52 +08:00