Message ID | 20240731145855.3122166-1-vigneshr@ti.com |
---|---|
State | Accepted |
Delegated to: | Tom Rini |
Headers | show |
Series | mtd: nand: raw: omap_gpmc: Check return value of gpmc_nand_init | expand |
On 31/07/2024 17:58, Vignesh Raghavendra wrote: > 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 <vigneshr@ti.com> Acked-by: Roger Quadros <rogerq@kernel.org>
On Wed, 31 Jul 2024 20:28:55 +0530, Vignesh Raghavendra wrote: > 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!
Hi Tom On Wed, Aug 28, 2024 at 1:22 AM Tom Rini <trini@konsulko.com> wrote: > > On Wed, 31 Jul 2024 20:28:55 +0530, Vignesh Raghavendra wrote: > > > 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! > > -- > Tom > > Thank you to pick it up, I did not see it Michael
diff --git a/drivers/mtd/nand/raw/omap_gpmc.c b/drivers/mtd/nand/raw/omap_gpmc.c index 92a92ad63a02..a36e2a148ccc 100644 --- a/drivers/mtd/nand/raw/omap_gpmc.c +++ b/drivers/mtd/nand/raw/omap_gpmc.c @@ -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));
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 <vigneshr@ti.com> --- drivers/mtd/nand/raw/omap_gpmc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)