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] [day] [month] [year] [list]
Date: Tue, 20 Feb 2024 10:59:00 +0100
From: Michal Simek <michal.simek@....com>
To: Dan Carpenter <dan.carpenter@...aro.org>, Rob Herring <robh@...nel.org>
Cc: Arnd Bergmann <arnd@...db.de>,
 Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
 Uwe Kleine-König <u.kleine-koenig@...gutronix.de>,
 Benjamin Tissoires <benjamin.tissoires@...hat.com>,
 Ivan Orlov <ivan.orlov0322@...il.com>, linux-arm-kernel@...ts.infradead.org,
 linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] char: xilinx_hwicap: Fix NULL vs IS_ERR() bug



On 2/20/24 10:02, Dan Carpenter wrote:
> The devm_platform_ioremap_resource() function returns error pointers.
> It never returns NULL.  Update the check accordingly.
> 
> Fixes: 672371832193 ("char: xilinx_hwicap: Modernize driver probe")
> Signed-off-by: Dan Carpenter <dan.carpenter@...aro.org>
> ---
>   drivers/char/xilinx_hwicap/xilinx_hwicap.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/char/xilinx_hwicap/xilinx_hwicap.c b/drivers/char/xilinx_hwicap/xilinx_hwicap.c
> index 019cf6079cec..6d2eadefd9dc 100644
> --- a/drivers/char/xilinx_hwicap/xilinx_hwicap.c
> +++ b/drivers/char/xilinx_hwicap/xilinx_hwicap.c
> @@ -639,8 +639,8 @@ static int hwicap_setup(struct platform_device *pdev, int id,
>   	dev_set_drvdata(dev, (void *)drvdata);
>   
>   	drvdata->base_address = devm_platform_ioremap_resource(pdev, 0);
> -	if (!drvdata->base_address) {
> -		retval = -ENODEV;
> +	if (IS_ERR(drvdata->base_address)) {
> +		retval = PTR_ERR(drvdata->base_address);
>   		goto failed;
>   	}
>   

Acked-by: Michal Simek <michal.simek@....com>

Thanks,
Michal

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ