[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220425110845.415439-1-renyu@nfschina.com>
Date: Mon, 25 Apr 2022 19:08:45 +0800
From: Ren Yu <renyu@...china.com>
To: tony@...mide.com
Cc: aaro.koskinen@....fi, linux@...linux.org.uk,
linux-omap@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org, liqiong@...china.com,
yuzhe@...china.com, Ren Yu <renyu@...china.com>
Subject: [PATCH] plat-omap: check return value of ioremap()
When ioremap() failed,return err
Signed-off-by: Ren Yu <renyu@...china.com>
---
arch/arm/plat-omap/debug-leds.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/arm/plat-omap/debug-leds.c b/arch/arm/plat-omap/debug-leds.c
index 2b698d074874..bf5034e10f6e 100644
--- a/arch/arm/plat-omap/debug-leds.c
+++ b/arch/arm/plat-omap/debug-leds.c
@@ -109,6 +109,9 @@ static int fpga_probe(struct platform_device *pdev)
return -ENODEV;
fpga = ioremap(iomem->start, resource_size(iomem));
+ if (!fpga)
+ return -ENOMEM;
+
writew_relaxed(0xff, &fpga->leds);
for (i = 0; i < ARRAY_SIZE(dbg_leds); i++) {
--
2.25.1
Powered by blists - more mailing lists