kernel_samsung_a53x/drivers/mtd/devices
Mirsad Todorovac 4201ddc847 mtd: slram: insert break after errors in parsing the map
[ Upstream commit 336c218dd7f0588ed8a7345f367975a00a4f003f ]

GCC 12.3.0 compiler on linux-next next-20240709 tree found the execution
path in which, due to lazy evaluation, devlength isn't initialised with the
parsed string:

   289		while (map) {
   290			devname = devstart = devlength = NULL;
   291
   292			if (!(devname = strsep(&map, ","))) {
   293				E("slram: No devicename specified.\n");
   294				break;
   295			}
   296			T("slram: devname = %s\n", devname);
   297			if ((!map) || (!(devstart = strsep(&map, ",")))) {
   298				E("slram: No devicestart specified.\n");
   299			}
   300			T("slram: devstart = %s\n", devstart);
 → 301			if ((!map) || (!(devlength = strsep(&map, ",")))) {
   302				E("slram: No devicelength / -end specified.\n");
   303			}
 → 304			T("slram: devlength = %s\n", devlength);
   305			if (parse_cmdline(devname, devstart, devlength) != 0) {
   306				return(-EINVAL);
   307			}

Parsing should be finished after map == NULL, so a break is best inserted after
each E("slram: ... \n") error message.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
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
Signed-off-by: Mirsad Todorovac <mtodorovac69@gmail.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20240711234319.637824-1-mtodorovac69@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-23 23:21:20 +01:00
..
bcm47xxsflash.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bcm47xxsflash.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
block2mtd.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
docg3.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
docg3.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
lart.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mchp23k256.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ms02-nv.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ms02-nv.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mtd_dataflash.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mtdram.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
phram.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pmc551.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
powernv_flash.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
serial_flash_cmds.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
slram.c mtd: slram: insert break after errors in parsing the map 2024-11-23 23:21:20 +01:00
spear_smi.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sst25l.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
st_spi_fsm.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00