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

Commit acbc5f92 authored by Shyam Kumar Thella's avatar Shyam Kumar Thella
Browse files

power: qpnp-smb5: Fix Initialize mutex for PD typec designs



Dump stack is observed when mutex (typec_lock) is locked without
initializing it in case of PD supported typec designs. Fix it by
initializing the mutex for PD supported typec designs also.

Change-Id: I7ee29715651dc001a450d80c49c6cce10f10e837
Signed-off-by: default avatarShyam Kumar Thella <sthella@codeaurora.org>
parent 200519aa
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -3510,11 +3510,12 @@ static int smb5_init_typec_class(struct smb5 *chip)
	struct smb_charger *chg = &chip->chg;
	int rc = 0;

	mutex_init(&chg->typec_lock);

	/* Register typec class for only non-PD TypeC and uUSB designs */
	if (!chg->pd_not_supported)
		return rc;

	mutex_init(&chg->typec_lock);
	chg->typec_caps.type = TYPEC_PORT_DRP;
	chg->typec_caps.data = TYPEC_PORT_DRD;
	chg->typec_partner_desc.usb_pd = false;