linux-stable/drivers/mtd
Wen Yang 9e303d5249 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:30:24 +02:00
..
chips mtd: cfi_cmdset_0002: Use chip_good() to retry in do_write_oneword() 2019-10-01 08:26:02 +02:00
devices mtd: phram: fix a double free issue in error path 2020-04-23 10:30:24 +02:00
lpddr mtd: lpddr: Fix a double free in probe() 2020-04-23 10:30:23 +02:00
maps mtd: physmap_of: Release resources on error 2019-11-24 08:20:17 +01:00
nand mtd: spinand: Explicitly use MTD_OPS_RAW to write the bad block marker to OOB 2020-04-23 10:30:23 +02:00
parsers mtd: sharpslpart: Fix unsigned comparison to zero 2020-02-14 16:33:27 -05:00
spi-nor mtd: spi-nor: fix silent truncation in spi_nor_read_raw() 2020-01-17 19:47:12 +01:00
tests
ubi ubi: Fix an error pointer dereference in error handling code 2020-02-11 04:34:14 -08:00
afs.c
ar7part.c
bcm47xxpart.c
bcm63xxpart.c
cmdlinepart.c
ftl.c
inftlcore.c
inftlmount.c
Kconfig
Makefile
mtd_blkdevs.c
mtdblock.c
mtdblock_ro.c
mtdchar.c
mtdconcat.c
mtdcore.c
mtdcore.h mtd: Check add_mtd_device() ret code 2019-12-05 09:21:05 +01:00
mtdoops.c
mtdpart.c mtd: Remove a debug trace in mtdpart.c 2019-12-05 09:21:24 +01:00
mtdsuper.c
mtdswap.c
nftlcore.c
nftlmount.c
ofpart.c
redboot.c
rfd_ftl.c
sm_ftl.c
sm_ftl.h
ssfdc.c