]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
power: supply: sbs-battery: Fix a signedness bug in sbs_get_battery_capacity()
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 25 Sep 2019 11:01:28 +0000 (14:01 +0300)
committerSebastian Reichel <sre@kernel.org>
Tue, 14 Jan 2020 00:26:14 +0000 (01:26 +0100)
commiteb368de6de32925c65a97c1e929a31cae2155aee
tree3fe792580977f94c7e304353fb6aa47a9841f08c
parenta60ec78d306c6548d4adbc7918b587a723c555cc
power: supply: sbs-battery: Fix a signedness bug in sbs_get_battery_capacity()

The "mode" variable is an enum and in this context GCC treats it as an
unsigned int so the error handling is never triggered.

Fixes: 51d075660457 ("bq20z75: Add support for charge properties")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/sbs-battery.c