mtd: nand: raw: omap_gpmc: Check return value of gpmc_nand_init
Subsystems (2)
Vignesh Raghavendra
maintainerPATCH 1/1 mtd: nand: raw: omap_gpmc: Check return value of gpmc_nand_init
If the function is called with no NAND device attached, then this function can return error value, proceeding further ignoring the same can cause system crash. This is seen when "mtd list" is run with no NAND addon cards connected.
--- drivers/mtd/nand/raw/omap_gpmc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/mtd/nand/raw/omap_gpmc.c +4 -1
@@ -1188,7 +1188,10 @@ static int gpmc_nand_probe(struct udevice *dev)return ret; base =devm_ioremap (dev, res.start,resource_size (&res)); -gpmc_nand_init (nand, base); + ret =gpmc_nand_init (nand, base); +if (ret) +return ret; + mtd->dev = dev;nand_set_flash_node (nand,dev_ofnode (dev));
Signature · 1 line
2.45.2
Quoted 6 lines · Vignesh Raghavendra
If the function is called with no NAND device attached, then this function can return error value, proceeding further ignoring the same can cause system crash. This is seen when "mtd list" is run with no NAND addon cards connected.
Signed-off-by Vignesh Raghavendra <[email protected]>
Quoted 6 lines · Vignesh Raghavendra
If the function is called with no NAND device attached, then this function can return error value, proceeding further ignoring the same can cause system crash. This is seen when "mtd list" is run with no NAND addon cards connected.
Applied to u-boot/next, thanks!
Signature · 1 line
Tom
Hi Tom
Quoted 10 lines · Tom Rini
Quoted 6 lines · Vignesh Raghavendra
If the function is called with no NAND device attached, then this function can return error value, proceeding further ignoring the same can cause system crash. This is seen when "mtd list" is run with no NAND addon cards connected.
Quoted 6 lines
Applied to u-boot/next, thanks!
--
Tom
Thank you to pick it up, I did not see it
Michael
Signature · 11 lines
Michael Nazzareno Trimarchi Co-Founder & Chief Executive Officer M. +39 347 913 2170 [email protected] __________________________________ Amarula Solutions BV Joop Geesinkweg 125, 1114 AB, Amsterdam, NL T. +31 (0)85 111 9172 [email protected] www.amarulasolutions.com