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: <YjMac/pwFH5Z+Lxs@latitude>
Date:   Thu, 17 Mar 2022 12:24:35 +0100
From:   Jonathan Neuschäfer <j.neuschaefer@....net>
To:     Jialin Zhang <zhangjialin11@...wei.com>
Cc:     j.neuschaefer@....net, linus.walleij@...aro.org,
        openbmc@...ts.ozlabs.org, linux-gpio@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH -next] pinctrl: nuvoton: Fix return value check in
 wpcm450_gpio_register()

On Thu, Mar 17, 2022 at 02:58:51PM +0800, Jialin Zhang wrote:
> In case of error, the function devm_platform_ioremap_resource()
> returns ERR_PTR() and never returns NULL. The NULL test in the
> return value check should be replaced with IS_ERR().

Right.

> 
> Fixes: a1d1e0e3d80a ("pinctrl: nuvoton: Add driver for WPCM450")
> Reported-by: Hulk Robot <hulkci@...wei.com>
> Signed-off-by: Jialin Zhang <zhangjialin11@...wei.com>
> ---
>  drivers/pinctrl/nuvoton/pinctrl-wpcm450.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c b/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c
> index 661aa963e3fc..a71b684b9b44 100644
> --- a/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c
> +++ b/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c
> @@ -1019,8 +1019,9 @@ static int wpcm450_gpio_register(struct platform_device *pdev,
>  	int ret;
>  
>  	pctrl->gpio_base = devm_platform_ioremap_resource(pdev, 0);
> -	if (!pctrl->gpio_base)
> -		return dev_err_probe(dev, -ENOMEM, "Resource fail for GPIO controller\n");
> +	if (IS_ERR(pctrl->gpio_base))
> +		return dev_err_probe(dev, PTR_ERR(pctrl->gpio_base),
> +				     "Resource fail for GPIO controller\n");
>  

Reviewed-by: Jonathan Neuschäfer <j.neuschaefer@....net>


Thanks!
Jonathan

Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ