From 7fa2f55c9bb64cdabdeffbf351ec7fc2bcc1b038 Mon Sep 17 00:00:00 2001 From: Umesh Vats Date: Thu, 19 Dec 2019 12:21:35 -0800 Subject: [PATCH] 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 --- drivers/bluetooth/btpower.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/bluetooth/btpower.c b/drivers/bluetooth/btpower.c index a997582f7997..cf73041ac771 100644 --- a/drivers/bluetooth/btpower.c +++ b/drivers/bluetooth/btpower.c @@ -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;