lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZIDFDgcM07aPlzoB@surfacebook>
Date:   Wed, 7 Jun 2023 20:57:34 +0300
From:   andy.shevchenko@...il.com
To:     Jiasheng Jiang <jiasheng@...as.ac.cn>
Cc:     avifishman70@...il.com, tmaimon77@...il.com, tali.perry1@...il.com,
        venture@...gle.com, yuenn@...gle.com, benjaminfair@...gle.com,
        linus.walleij@...aro.org, openbmc@...ts.ozlabs.org,
        linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] pinctrl: npcm7xx: Add missing check for ioremap

Wed, Jun 07, 2023 at 05:58:29PM +0800, Jiasheng Jiang kirjoitti:
> Add check for ioremap() and return the error if it fails in order to
> guarantee the success of ioremap().

This one is correct, otherwise the GPIO is not functional at all.
Reviewed-by: Andy Shevchenko <andy.shevchenko@...il.com>

> Fixes: 3b588e43ee5c ("pinctrl: nuvoton: add NPCM7xx pinctrl and GPIO driver")
> Signed-off-by: Jiasheng Jiang <jiasheng@...as.ac.cn>
> ---
>  drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c b/drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c
> index 21e61c2a3798..843ffcd96877 100644
> --- a/drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c
> +++ b/drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c
> @@ -1884,6 +1884,8 @@ static int npcm7xx_gpio_of(struct npcm7xx_pinctrl *pctrl)
>  		}
>  
>  		pctrl->gpio_bank[id].base = ioremap(res.start, resource_size(&res));
> +		if (!pctrl->gpio_bank[id].base)
> +			return -EINVAL;
>  
>  		ret = bgpio_init(&pctrl->gpio_bank[id].gc, dev, 4,
>  				 pctrl->gpio_bank[id].base + NPCM7XX_GP_N_DIN,

-- 
With Best Regards,
Andy Shevchenko


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ