diff options
| author | Tom Rix <trix@redhat.com> | 2020-07-12 12:23:51 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-08-21 10:53:02 +0200 |
| commit | 2bb65635094df097893a9b542552853bd29a6be9 (patch) | |
| tree | c75f5aa97eae0ed2c263334208659c9bd1ef3b40 /include/linux/debugobjects.h | |
| parent | 23e854676593fa65adf1f103aec84e7a03a396e1 (diff) | |
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: 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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include/linux/debugobjects.h')
0 files changed, 0 insertions, 0 deletions
