android_kernel_xiaomi_sm7250/drivers/power/supply
Tom Rix 6b03a2a347 power: supply: check if calc_soc succeeded in pm860x_init_battery
[ Upstream commit ccf193dee1f0fff55b556928591f7818bac1b3b1 ]

clang static analysis flags this error

88pm860x_battery.c:522:19: warning: Assigned value is
  garbage or undefined [core.uninitialized.Assign]
                info->start_soc = soc;
                                ^ ~~~
soc is set by calling calc_soc.
But calc_soc can return without setting soc.

So check the return status and bail similarly to other
checks in pm860x_init_battery and initialize soc to
silence the warning.

Fixes: a830d28b48 ("power_supply: Enable battery-charger for 88pm860x")

Signed-off-by: Tom Rix <trix@redhat.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-08-19 08:14:59 +02:00
..
88pm860x_battery.c power: supply: check if calc_soc succeeded in pm860x_init_battery 2020-08-19 08:14:59 +02:00
88pm860x_charger.c
ab8500_bmdata.c
ab8500_btemp.c
ab8500_charger.c
ab8500_fg.c
abx500_chargalg.c
act8945a_charger.c
adp5061.c
apm_power.c
axp20x_ac_power.c
axp20x_battery.c
axp20x_usb_power.c
axp288_charger.c
axp288_fuel_gauge.c
bq27xxx_battery_hdq.c
bq27xxx_battery_i2c.c
bq27xxx_battery.c
bq2415x_charger.c
bq24190_charger.c
bq24257_charger.c
bq24735-charger.c
bq25890_charger.c
charger-manager.c
collie_battery.c
cpcap-battery.c
cpcap-charger.c
cros_usbpd-charger.c
da9030_battery.c
da9052-battery.c
da9150-charger.c
da9150-fg.c
ds2760_battery.c
ds2780_battery.c
ds2781_battery.c
ds2782_battery.c
generic-adc-battery.c
goldfish_battery.c
gpio-charger.c
ipaq_micro_battery.c
isp1704_charger.c
jz4740-battery.c
Kconfig
lego_ev3_battery.c
lp8727_charger.c
lp8788-charger.c
ltc2941-battery-gauge.c
ltc3651-charger.c
Makefile
max1721x_battery.c
max8903_charger.c
max8925_power.c
max8997_charger.c
max8998_charger.c
max14577_charger.c
max14656_charger_detector.c
max17040_battery.c
max17042_battery.c
max77693_charger.c
olpc_battery.c
pcf50633-charger.c
pda_power.c
pm2301_charger.c
pm2301_charger.h
pmu_battery.c
power_supply_core.c
power_supply_leds.c
power_supply_sysfs.c
power_supply.h
qcom_smbb.c
rt5033_battery.c
rt9455_charger.c
rx51_battery.c
s3c_adc_battery.c
sbs-battery.c
sbs-charger.c
sbs-manager.c
smb347-charger.c power: supply: smb347-charger: IRQSTAT_D is volatile 2020-06-25 15:32:55 +02:00
test_power.c
tosa_battery.c
tps65090-charger.c
tps65217_charger.c
twl4030_charger.c
twl4030_madc_battery.c
wm97xx_battery.c
wm831x_backup.c
wm831x_power.c
wm8350_power.c
z2_battery.c