You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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: a830d28 ("power_supply: Enable battery-charger for 88pm860x")
Signed-off-by: Tom Rix <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
0 commit comments