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-next>] [day] [month] [year] [list]
Message-ID: <20121202203421.1ad1f6dc@notabene.brown>
Date:	Sun, 2 Dec 2012 20:34:21 +1100
From:	NeilBrown <neilb@...e.de>
To:	Anton Vorontsov <anton.vorontsov@...aro.org>
Cc:	Lars-Peter Clausen <lars@...afoo.de>,
	Saranya Gopal <saranya.gopal@...el.com>,
	David Woodhouse <dwmw2@...radead.org>,
	lkml <linux-kernel@...r.kernel.org>
Subject: [PATCH] bq27x00_battery: fix bugs introduced with BQ27425 support



commit a66f59ba2e994bf70274ef0513e24e0e7ae20c63
    bq27x00_battery: Add support for BQ27425 chip

introduced 2 bug.

1/ 'chip' was set to BQ27425 unconditionally - breaking support for
   other devices.
2/ BQ27425 does not support cycle count, how the code still tries to
   get the cycle count for BQ27425, and now does it twice for other chips.

Cc: Saranya Gopal <saranya.gopal@...el.com>
Signed-off-by: NeilBrown <neilb@...e.de>

diff --git a/drivers/power/bq27x00_battery.c b/drivers/power/bq27x00_battery.c
index e2659f1..51d4017 100644
--- a/drivers/power/bq27x00_battery.c
+++ b/drivers/power/bq27x00_battery.c
@@ -445,7 +445,6 @@ static void bq27x00_update(struct bq27x00_device_info *di)
 		cache.temperature = bq27x00_battery_read_temperature(di);
 		if (!is_bq27425)
 			cache.cycle_count = bq27x00_battery_read_cyct(di);
-		cache.cycle_count = bq27x00_battery_read_cyct(di);
 		cache.power_avg =
 			bq27x00_battery_read_pwr_avg(di, BQ27x00_POWER_AVG);
 
@@ -697,7 +696,6 @@ static int bq27x00_powersupply_init(struct bq27x00_device_info *di)
 	int ret;
 
 	di->bat.type = POWER_SUPPLY_TYPE_BATTERY;
-	di->chip = BQ27425;
 	if (di->chip == BQ27425) {
 		di->bat.properties = bq27425_battery_props;
 		di->bat.num_properties = ARRAY_SIZE(bq27425_battery_props);

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ