android_kernel_xiaomi_sm8350/drivers/mtd/devices
Wen Yang 5d53bfdce0 mtd: phram: fix a double free issue in error path
commit 49c64df880570034308e4a9a49c4bc95cf8cdb33 upstream.

The variable 'name' is released multiple times in the error path,
which may cause double free issues.
This problem is avoided by adding a goto label to release the memory
uniformly. And this change also makes the code a bit more cleaner.

Fixes: 4f678a58d3 ("mtd: fix memory leaks in phram_setup")
Signed-off-by: Wen Yang <wenyang@linux.alibaba.com>
Cc: Joern Engel <joern@lazybastard.org>
Cc: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Richard Weinberger <richard@nod.at>
Cc: Vignesh Raghavendra <vigneshr@ti.com>
Cc: linux-mtd@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200318153156.25612-1-wenyang@linux.alibaba.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-23 10:36:45 +02:00
..
bcm47xxsflash.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
bcm47xxsflash.h
block2mtd.c mtd: block2mtd: mark expected switch fall-throughs 2018-11-09 20:32:43 +01:00
docg3.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
docg3.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
Kconfig mtd: spi-nor: Move m25p80 code in spi-nor.c 2019-08-12 10:54:12 +03:00
lart.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 420 2019-06-05 17:37:15 +02:00
Makefile mtd: spi-nor: Move m25p80 code in spi-nor.c 2019-08-12 10:54:12 +03:00
mchp23k256.c mtd: devices: fix mchp23k256 read and write 2020-01-23 08:22:57 +01:00
ms02-nv.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
ms02-nv.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
mtd_dataflash.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
mtdram.c mtd: mtdram: Expose module parameters 2019-01-08 12:42:57 +01:00
phram.c mtd: phram: fix a double free issue in error path 2020-04-23 10:36:45 +02:00
pmc551.c mtd: pmc551: Remove set but not used variable 'soff_lo' 2019-09-15 23:51:07 +02:00
powernv_flash.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
serial_flash_cmds.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 420 2019-06-05 17:37:15 +02:00
slram.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
spear_smi.c mtd: spear_smi: Fix Write Burst mode 2019-12-17 19:55:53 +01:00
sst25l.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 420 2019-06-05 17:37:15 +02:00
st_spi_fsm.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 420 2019-06-05 17:37:15 +02:00