linux-stable/drivers/mtd/devices
Wen Yang bab44430dc 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-24 08:01:24 +02:00
..
bcm47xxsflash.c
bcm47xxsflash.h
block2mtd.c
docg3.c
docg3.h
Kconfig
lart.c
m25p80.c
Makefile
mchp23k256.c
ms02-nv.c
ms02-nv.h
mtd_dataflash.c
mtdram.c
phram.c
pmc551.c
powernv_flash.c
serial_flash_cmds.h
slram.c
spear_smi.c
sst25l.c
st_spi_fsm.c