Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mtd: phram: Fix error return code in phram_setup()

Return a negative error code from the error handling case instead
of 0, as done elsewhere in this function.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20210408133812.1209798-1-yukuai3@huawei.com

authored by

Yu Kuai and committed by
Miquel Raynal
da1e6fe5 c054de10

+1
+1
drivers/mtd/devices/phram.c
··· 270 270 if (len == 0 || erasesize == 0 || erasesize > len 271 271 || erasesize > UINT_MAX || rem) { 272 272 parse_err("illegal erasesize or len\n"); 273 + ret = -EINVAL; 273 274 goto error; 274 275 } 275 276