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]
Message-ID: <20211023234745.GA3703155@roeck-us.net>
Date:   Sat, 23 Oct 2021 16:47:45 -0700
From:   Guenter Roeck <linux@...ck-us.net>
To:     Kai Song <songkai01@...pur.com>
Cc:     jdelvare@...e.com, linux-hwmon@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] hwmon: (xgene) fix return value in xgene_hwmon_probe()

On Fri, Oct 22, 2021 at 04:44:46PM +0800, Kai Song wrote:
> It uses IS_ERR to judge the return value of mbox_request_channel()
> and pcc_mbox_request_channel().If it is invalid, maybe we should
> use PTR_ERR to get the correct return value.
> 

Only if the error reflects something else than -ENODEV, ie than
a missing device.

Guenter

> Signed-off-by: Kai Song <songkai01@...pur.com>
> ---
>  drivers/hwmon/xgene-hwmon.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/hwmon/xgene-hwmon.c b/drivers/hwmon/xgene-hwmon.c
> index 382ef0395d8e..fd0847f251c0 100644
> --- a/drivers/hwmon/xgene-hwmon.c
> +++ b/drivers/hwmon/xgene-hwmon.c
> @@ -648,7 +648,7 @@ static int xgene_hwmon_probe(struct platform_device *pdev)
>  		if (IS_ERR(ctx->mbox_chan)) {
>  			dev_err(&pdev->dev,
>  				"SLIMpro mailbox channel request failed\n");
> -			rc = -ENODEV;
> +			rc = PTR_ERR(ctx->mbox_chan);
>  			goto out_mbox_free;
>  		}
>  	} else {
> @@ -675,7 +675,7 @@ static int xgene_hwmon_probe(struct platform_device *pdev)
>  		if (IS_ERR(ctx->mbox_chan)) {
>  			dev_err(&pdev->dev,
>  				"PPC channel request failed\n");
> -			rc = -ENODEV;
> +			rc = PTR_ERR(ctx->mbox_chan);
>  			goto out_mbox_free;
>  		}
>  
> -- 
> 2.27.0
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ