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

Commit 4e619b4a authored by Harry Yang's avatar Harry Yang
Browse files

power: smb-lib: fix a mutex deadlock issue



An early error return without releasing a mutex in functon
smblib_vbus_regulator_enable will lead to deadlock in some
situation.

Fix it.

Change-Id: I41178ee3aadfae57566e5f14f81ed82b7b1986cc
Signed-off-by: default avatarHarry Yang <harryy@codeaurora.org>
parent 2fed71ce
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -1462,8 +1462,10 @@ int smblib_vbus_regulator_enable(struct regulator_dev *rdev)
	if (!chg->usb_icl_votable) {
		chg->usb_icl_votable = find_votable("USB_ICL");

		if (!chg->usb_icl_votable)
			return -EINVAL;
		if (!chg->usb_icl_votable) {
			rc = -EINVAL;
			goto unlock;
		}
	}
	vote(chg->usb_icl_votable, USBIN_USBIN_BOOST_VOTER, true, 0);