1
0
Fork 0
freescale-linux-fslc/drivers/mtd/parsers
Manivannan Sadhasivam 0edd035143 mtd: parsers: afs: Fix freeing the part name memory in failure
[ Upstream commit 7b844cf445 ]

In the case of failure while parsing the partitions, the iterator should
be pre decremented by one before starting to free the memory allocated
by kstrdup(). Because in the failure case, kstrdup() will not succeed
and thus no memory will be allocated for the current iteration.

Fixes: 1fca1f6abb ("mtd: afs: simplify partition parsing")
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20210104041137.113075-5-manivannan.sadhasivam@linaro.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-03-04 11:37:45 +01:00
..
Kconfig mtd: parsers: bcm63xx: Do not make it modular 2020-10-02 09:09:08 +02:00
Makefile mtd: parsers: Move CMDLINE parser 2019-09-15 23:50:50 +02:00
afs.c mtd: parsers: afs: Fix freeing the part name memory in failure 2021-03-04 11:37:45 +01:00
ar7part.c mtd: parsers: Move TI AR7 parser 2019-09-15 23:50:48 +02:00
bcm47xxpart.c mtd: parsers: Move BCM47xx parser 2019-09-15 23:50:48 +02:00
bcm63xxpart.c mtd: parsers: bcm63xx: simplify CFE detection 2020-06-26 08:35:10 +02:00
cmdlinepart.c mtd: parser: cmdline: Fix parsing of part-names with colons 2020-12-30 11:54:23 +01:00
ofpart.c mtd: partitions: ofpart: Parse the slc-mode property 2020-05-11 09:51:42 +02:00
parser_imagetag.c mtd: parser: imagetag: fix error codes in bcm963xx_parse_imagetag_partitions() 2021-03-04 11:37:44 +01:00
parser_trx.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
redboot.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 102 2019-05-24 17:39:00 +02:00
sharpslpart.c mtd: sharpslpart: Fix unsigned comparison to zero 2020-01-21 20:00:34 +01:00