Bluetooth: Re-initialize regulator to NULL on error

Reset the regulator to NULL when its allocation fails.

Change-Id: I6ee732c66c1f94a2d03004d417c263bb5271fbdb
Signed-off-by: Umesh Vats <uvats@codeaurora.org>
This commit is contained in:
Umesh Vats 2019-12-16 15:08:17 -08:00 committed by Gerrit - the friendly Code Review server
parent 9da451ae25
commit 6cc10bff8d

View file

@ -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;