diff mbox series

plat-omap: check return value of ioremap()

Message ID 20220425110845.415439-1-renyu@nfschina.com (mailing list archive)
State New, archived
Headers show
Series plat-omap: check return value of ioremap() | expand

Commit Message

Ren Yu April 25, 2022, 11:08 a.m. UTC
When ioremap() failed,return err

Signed-off-by: Ren Yu <renyu@nfschina.com>
---
 arch/arm/plat-omap/debug-leds.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Tony Lindgren April 26, 2022, 8:05 a.m. UTC | #1
Hi,

* Ren Yu <renyu@nfschina.com> [220425 11:08]:
> When ioremap() failed,return err

This file is no longer being used and getting removed in Linux next.
See commit 7058e68c2fed ("ARM: omap: remove debug-leds driver").

Thanks,

Tony

> Signed-off-by: Ren Yu <renyu@nfschina.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
>
diff mbox series

Patch

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++) {