Patch "power: supply: qcom_pmi8998_charger: fix uninitialized variable" has been added to the 6.5-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    power: supply: qcom_pmi8998_charger: fix uninitialized variable

to the 6.5-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     power-supply-qcom_pmi8998_charger-fix-uninitialized-.patch
and it can be found in the queue-6.5 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 123ff7cf1cd9bfb55bbb1a009144991bea78a8bd
Author: Yu Liao <liaoyu15@xxxxxxxxxx>
Date:   Wed Aug 2 10:31:30 2023 +0800

    power: supply: qcom_pmi8998_charger: fix uninitialized variable
    
    [ Upstream commit 13a0d1088c8fea1565e30a169188b59bdd77759e ]
    
    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: 8648aeb5d7b7 ("power: supply: add Qualcomm PMI8998 SMB2 Charger driver")
    Reported-by: kernel test robot <lkp@xxxxxxxxx>
    Closes: https://lore.kernel.org/r/202307280638.556PrzIS-lkp@xxxxxxxxx/
    Signed-off-by: Yu Liao <liaoyu15@xxxxxxxxxx>
    Reviewed-by: Caleb Connolly <caleb.connolly@xxxxxxxxxx
    Link: https://lore.kernel.org/r/20230802023130.2516232-1-liaoyu15@xxxxxxxxxx
    Signed-off-by: Sebastian Reichel <sebastian.reichel@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/power/supply/qcom_pmi8998_charger.c b/drivers/power/supply/qcom_pmi8998_charger.c
index d16c5ee172496..cac89d233c388 100644
--- a/drivers/power/supply/qcom_pmi8998_charger.c
+++ b/drivers/power/supply/qcom_pmi8998_charger.c
@@ -556,7 +556,8 @@ static int smb2_set_current_limit(struct smb2_chip *chip, unsigned int val)
 static void smb2_status_change_work(struct work_struct *work)
 {
 	unsigned int charger_type, current_ua;
-	int usb_online, count, rc;
+	int usb_online = 0;
+	int count, rc;
 	struct smb2_chip *chip;
 
 	chip = container_of(work, struct smb2_chip, status_change_work.work);



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux