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: <20241125175957.rulndmny536pd5c6@pali>
Date: Mon, 25 Nov 2024 18:59:57 +0100
From: Pali Rohár <pali@...nel.org>
To: "Sicelo A. Mhlongo" <absicsz@...il.com>
Cc: Krzysztof Kozlowski <krzk@...nel.org>, linux-pm@...r.kernel.org,
	sre@...nel.org, linux-kernel@...r.kernel.org,
	maemo-leste@...ts.dyne.org
Subject: Re: [PATCH] power: supply: bq27xxx_battery: do not update cached
 flags prematurely

cc Krzysztof, author of the mentioned commit.

On Monday 25 November 2024 17:29:30 Sicelo A. Mhlongo wrote:
> Commit 243f8ffc883a1 ("power: supply: bq27xxx_battery: Notify also about
> status changes") intended to notify userspace when the status changes,
> based on the flags register. However, the cached state is updated too
> early, before the flags are tested for any changes. Remove the premature
> update.
> 
> Fixes: 243f8ffc883a1 ("power: supply: bq27xxx_battery: Notify also about status changes")
> Signed-off-by: Sicelo A. Mhlongo <absicsz@...il.com>
> ---
>  drivers/power/supply/bq27xxx_battery.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/power/supply/bq27xxx_battery.c b/drivers/power/supply/bq27xxx_battery.c
> index 40c5ac7a1118..b2c65fe43d5c 100644
> --- a/drivers/power/supply/bq27xxx_battery.c
> +++ b/drivers/power/supply/bq27xxx_battery.c
> @@ -1913,7 +1913,6 @@ static void bq27xxx_battery_update_unlocked(struct bq27xxx_device_info *di)
>  		cache.flags = -1; /* read error */
>  	if (cache.flags >= 0) {
>  		cache.capacity = bq27xxx_battery_read_soc(di);
> -		di->cache.flags = cache.flags;
>  
>  		/*
>  		 * On gauges with signed current reporting the current must be
> -- 
> 2.45.2
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ