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

Commit 6cc10bff authored by Umesh Vats's avatar Umesh Vats Committed by Gerrit - the friendly Code Review server
Browse files

Bluetooth: Re-initialize regulator to NULL on error



Reset the regulator to NULL when its allocation fails.

Change-Id: I6ee732c66c1f94a2d03004d417c263bb5271fbdb
Signed-off-by: default avatarUmesh Vats <uvats@codeaurora.org>
parent 9da451ae
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -62,6 +62,7 @@ static int bt_vreg_init(struct bt_power_vreg_data *vreg)
	vreg->reg = regulator_get(dev, vreg->name);
	if (IS_ERR(vreg->reg)) {
		rc = PTR_ERR(vreg->reg);
		vreg->reg = NULL;
		pr_err("%s: regulator_get(%s) failed. rc=%d\n",
			__func__, vreg->name, rc);
		goto out;