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

Commit c6889839 authored by Wu Fenglin's avatar Wu Fenglin
Browse files

power: qpnp-charger: fix a variable uninitialized bug in ovp monitor



Commit 'c00e21ae' 'power: qpnp-charger: add charger OVP status
monitor' introduces a bug in 'qpnp_chg_usb_usbin_valid_irq_handler',
when 'usbin_health' value is not equal to 'USBIN_OVP' or 'USBIN_OK',
'psy_health_sts' will be used before initialized, this makes 'usb_phy'
change to an uncertain health state.

Change-Id: I95d7b119fc965afe957702e255fc376729e18856
Signed-off-by: default avatarWu Fenglin <fenglinw@codeaurora.org>
parent a40ca38d
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -1405,9 +1405,9 @@ qpnp_chg_usb_usbin_valid_irq_handler(int irq, void *_chip)
				       (chip->usb_valid_check_ovp)) {
				usbin_health =
					qpnp_chg_check_usbin_health(chip);
				if (chip->usbin_health != usbin_health) {
				if ((chip->usbin_health != usbin_health)
					&& (usbin_health == USBIN_OVP)) {
					chip->usbin_health = usbin_health;
					if (usbin_health == USBIN_OVP)
					psy_health_sts =
					POWER_SUPPLY_HEALTH_OVERVOLTAGE;
					power_supply_set_health_state(
@@ -1433,9 +1433,9 @@ qpnp_chg_usb_usbin_valid_irq_handler(int irq, void *_chip)
				       (chip->usb_valid_check_ovp)) {
				usbin_health =
					qpnp_chg_check_usbin_health(chip);
				if (chip->usbin_health != usbin_health) {
				if ((chip->usbin_health != usbin_health)
					&& (usbin_health == USBIN_OK)) {
					chip->usbin_health = usbin_health;
					 if (usbin_health == USBIN_OK)
					psy_health_sts =
						POWER_SUPPLY_HEALTH_GOOD;
					power_supply_set_health_state(