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 for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20230317194032.widpyvv6f4dqapla@mercury.elektranox.org>
Date:   Fri, 17 Mar 2023 20:40:32 +0100
From:   Sebastian Reichel <sebastian.reichel@...labora.com>
To:     Anton Gusev <aagusev@...ras.ru>
Cc:     linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org,
        lvc-project@...uxtesting.org
Subject: Re: [PATCH] power: supply: generic-adc-battery: remove redundant
 return code assignment

Hi,

On Fri, Mar 17, 2023 at 08:00:07PM +0300, Anton Gusev wrote:
> Since any subsequent uses of ret reassign it first and PTR_ERR does not
> have any effect on its own, this line has no effect and can be removed.
> 
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
> 
> Signed-off-by: Anton Gusev <aagusev@...ras.ru>
> ---

Thanks, but the correct thing to do is using ret, which is WIP:

https://lore.kernel.org/linux-pm/20230314225535.1321736-4-sre@kernel.org/T/#u

-- Sebastian

>  drivers/power/supply/generic-adc-battery.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/power/supply/generic-adc-battery.c b/drivers/power/supply/generic-adc-battery.c
> index 66039c665dd1..b51e5c4b36ff 100644
> --- a/drivers/power/supply/generic-adc-battery.c
> +++ b/drivers/power/supply/generic-adc-battery.c
> @@ -285,7 +285,6 @@ static int gab_probe(struct platform_device *pdev)
>  		adc_bat->channel[chan] = iio_channel_get(&pdev->dev,
>  							 gab_chan_name[chan]);
>  		if (IS_ERR(adc_bat->channel[chan])) {
> -			ret = PTR_ERR(adc_bat->channel[chan]);
>  			adc_bat->channel[chan] = NULL;
>  		} else {
>  			/* copying properties for supported channels only */
> -- 
> 2.39.2
> 

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