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

Commit dfa5d91a authored by David Collins's avatar David Collins
Browse files

msm: rpm-regulator-smd: remove incorrect rpm_regulator_get() unlock calls



The rpm_regulator_get() function calls rpm_vreg_unlock() in
failure paths after two kzalloc() calls.  However, there is no
corresponding rpm_vreg_lock() call before these calls.  Also, the
code being executed does not require mutual exclusion.  Thus,
remove the rpm_vreg_unlock() calls in order to avoid possible
locking problems if kzalloc() fails.

Change-Id: I0a0f2ffde5a6c54600a823e3ed12c3c47c3bac6a
Signed-off-by: default avatarDavid Collins <collinsd@codeaurora.org>
parent f3b7dfb7
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -932,7 +932,6 @@ struct rpm_regulator *rpm_regulator_get(struct device *dev, const char *supply)
	if (priv_reg == NULL) {
		vreg_err(framework_reg, "could not allocate memory for "
			"regulator\n");
		rpm_vreg_unlock(rpm_vreg);
		return ERR_PTR(-ENOMEM);
	}

@@ -945,7 +944,6 @@ struct rpm_regulator *rpm_regulator_get(struct device *dev, const char *supply)
		vreg_err(framework_reg, "could not allocate memory for "
			"regulator_dev\n");
		kfree(priv_reg);
		rpm_vreg_unlock(rpm_vreg);
		return ERR_PTR(-ENOMEM);
	}
	priv_reg->rdev->reg_data	= priv_reg;