android_kernel_motorola_sm6225/drivers/mtd/devices
Wen Yang 9e303d5249 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:30:24 +02:00
..
bcm47xxsflash.c
bcm47xxsflash.h
block2mtd.c
docg3.c
docg3.h
Kconfig mtd: docg3: don't set conflicting BCH_CONST_PARAMS option 2018-11-21 09:19:19 +01:00
lart.c
m25p80.c mtd: devices: m25p80: Make sure WRITE_EN is issued before each write 2019-11-24 08:20:41 +01:00
Makefile
mchp23k256.c mtd: devices: fix mchp23k256 read and write 2020-01-23 08:21:37 +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:30:24 +02:00
pmc551.c
powernv_flash.c
serial_flash_cmds.h
slram.c
spear_smi.c mtd: spear_smi: Fix Write Burst mode 2019-12-17 20:34:42 +01:00
sst25l.c
st_spi_fsm.c