linux/drivers/mtd
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
..
chips mtd: cfi_cmdset_0002: fix delayed error detection on HyperFlash 2020-01-23 08:22:57 +01:00
devices mtd: phram: fix a double free issue in error path 2020-04-23 10:36:45 +02:00
hyperbus mtd: hyperbus: fix dependency and build error 2019-08-29 14:31:23 +02:00
lpddr mtd: lpddr: Fix a double free in probe() 2020-04-23 10:36:45 +02:00
maps mtd: pismo: Simplify getting the adapter of a client 2019-09-15 23:50:39 +02:00
nand mtd: spinand: Explicitly use MTD_OPS_RAW to write the bad block marker to OOB 2020-04-23 10:36:44 +02:00
parsers mtd: sharpslpart: Fix unsigned comparison to zero 2020-02-14 16:34:18 -05:00
spi-nor mtd: spi-nor: Split mt25qu512a (n25q512a) entry into two 2020-02-11 04:35:45 -08:00
tests
ubi ubi: Fix an error pointer dereference in error handling code 2020-02-11 04:35:47 -08:00
Kconfig mtd: parsers: Move CMDLINE parser 2019-09-15 23:50:50 +02:00
Makefile mtd: parsers: Move CMDLINE parser 2019-09-15 23:50:50 +02:00
ftl.c
inftlcore.c
inftlmount.c
mtd_blkdevs.c
mtdblock.c
mtdblock_ro.c
mtdchar.c
mtdconcat.c
mtdcore.c mtd: mtdcore: add debugfs nodes for querying the flash name and id 2019-08-29 10:36:47 +03:00
mtdcore.h mtd: Provide fs_context-aware mount_mtd() replacement 2019-09-05 14:34:23 -04:00
mtdoops.c
mtdpart.c
mtdsuper.c mtd: Kill mount_mtd() 2019-09-05 14:34:26 -04:00
mtdswap.c
nftlcore.c
nftlmount.c
rfd_ftl.c
sm_ftl.c mtd: sm_ftl: Fix memory leak in sm_init_zone() error path 2019-09-15 23:50:50 +02:00
sm_ftl.h
ssfdc.c