Bluetooth: Re-initialize regulator to NULL on error

Reset the regulator to NULL when its allocation fails.

Change-Id: I5e9fcad83d0ed449c225c7c5c99d93ebae9848fc
Signed-off-by: Umesh Vats <uvats@codeaurora.org>
This commit is contained in:
Umesh Vats 2019-12-19 12:21:35 -08:00 • committed by Gerrit - the friendly Code Review server
commit 7fa2f55c9b

View file

@ -511,6 +511,7 @@ static int bt_power_vreg_set(enum bt_power_modes mode)
vreg_info->name);
if (IS_ERR(vreg_info->reg)) {
ret = PTR_ERR(vreg_info->reg);
vreg_info->reg = NULL;
pr_err("%s: regulator_get(%s) failed. rc=%d\n",
__func__, vreg_info->name, ret);
goto out;