Skip to content
Commit ccf193de authored by Tom Rix's avatar Tom Rix Committed by Sebastian Reichel
Browse files

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: a830d28b ("power_supply: Enable battery-charger for 88pm860x")

Signed-off-by: default avatarTom Rix <trix@redhat.com>
Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
parent 81bd45fc
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment