Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c94f04c2 authored by Anirudh Ghayal's avatar Anirudh Ghayal Committed by Abhijeet Dharmapurikar
Browse files

power: qpnp-smbcharger: Fix uninitialized access to dc_psy



Fix uninitialized access when dc_psy is not registered
and charging is enabled by sysfs interface.

CRs-Fixed: 836629
Change-Id: I88f1f2253c357a62589ea750a4394ef289f5573e
Signed-off-by: default avatarAnirudh Ghayal <aghayal@codeaurora.org>
parent 6cfab062
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1324,7 +1324,7 @@ static int smbchg_dc_en(struct smbchg_chip *chip, bool enable,
		goto out;
	}

	if (chip->psy_registered)
	if (chip->dc_psy_type != -EINVAL)
		power_supply_changed(&chip->dc_psy);
	pr_smb(PR_STATUS, "dc charging %s, suspended = %02x\n",
			suspended == 0 ? "enabled"