Skip to content
Commit 13a0d108 authored by Yu Liao's avatar Yu Liao Committed by Sebastian Reichel
Browse files

power: supply: qcom_pmi8998_charger: fix uninitialized variable



smatch warnings:
  drivers/power/supply/qcom_pmi8998_charger.c:565 smb2_status_change_work() error: uninitialized symbol 'usb_online'.

usb_online is used uninitialized whenever smb2_get_prop_usb_online()
returns a negative value.

Thus, fix the issue by initializing usb_online to 0.

Fixes: 8648aeb5 ("power: supply: add Qualcomm PMI8998 SMB2 Charger driver")
Reported-by: default avatarkernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/r/202307280638.556PrzIS-lkp@intel.com/


Signed-off-by: default avatarYu Liao <liaoyu15@huawei.com>
Reviewed-by: default avatarCaleb Connolly <caleb.connolly@linaro.org>
Link: https://lore.kernel.org/r/20230802023130.2516232-1-liaoyu15@huawei.com


Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
parent af73fd32
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