diff options
author | Tom Rix <trix@redhat.com> | 2020-07-12 12:23:51 -0700 |
---|---|---|
committer | Sebastian Reichel <sebastian.reichel@collabora.com> | 2020-07-28 02:13:21 +0200 |
commit | ccf193dee1f0fff55b556928591f7818bac1b3b1 (patch) | |
tree | b01cfbd7d52213e3cdc3ddf0828b346fb780140b /scripts/gcc-plugins/cyc_complexity_plugin.c | |
parent | 81bd45fc36e3d01db66c17fa5ed5f39a61e67477 (diff) |
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 'scripts/gcc-plugins/cyc_complexity_plugin.c')
0 files changed, 0 insertions, 0 deletions