diff options
author | 2020-07-12 12:23:51 -0700 | |
---|---|---|
committer | 2020-07-28 02:13:21 +0200 | |
commit | ccf193dee1f0fff55b556928591f7818bac1b3b1 (patch) | |
tree | b01cfbd7d52213e3cdc3ddf0828b346fb780140b /tools/perf/scripts/python/export-to-postgresql.py | |
parent | power: supply: bq2xxxx: Replace HTTP links with HTTPS ones (diff) | |
download | wireguard-linux-ccf193dee1f0fff55b556928591f7818bac1b3b1.tar.xz wireguard-linux-ccf193dee1f0fff55b556928591f7818bac1b3b1.zip |
power: supply: check if calc_soc succeeded in pm860x_init_battery
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: a830d28b48bf ("power_supply: Enable battery-charger for 88pm860x")
Signed-off-by: Tom Rix <trix@redhat.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions