linux-stable/drivers/mtd/devices
Wen Yang 5d53bfdce0 mtd: phram: fix a double free issue in error path
commit 49c64df880 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
bcm47xxsflash.h
block2mtd.c
docg3.c
docg3.h
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
ms02-nv.h
mtd_dataflash.c
mtdram.c
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
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