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:
parent
9da451ae25
commit
6cc10bff8d
1 changed files with 1 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue