aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeung-Woo Kim <sw0312.kim@samsung.com>2014-12-04 19:17:17 +0900
committerMister Oyster <oysterized@gmail.com>2017-04-11 11:00:01 +0200
commitbaf1d9e59d76cdfa43a66da09a5f7889cac0c250 (patch)
treeb36dc073051feaac0dd9a9acb54ca6c17ea85d1c
parent1e05178a1a33f58f5cf97b0082b0af02594fde18 (diff)
UPSTREAM: regulator: core: Fix regualtor_ena_gpio_free not to access pin after freeing
After freeing pin from regulator_ena_gpio_free, loop can access the pin. So this patch fixes not to access pin after freeing. Bug: 35399757 Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org> (cherry picked from commit 60a2362f769cf549dc466134efe71c8bf9fbaaba)
-rw-r--r--drivers/regulator/core.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index eaaae3080..0a2bf64f0 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1534,6 +1534,8 @@ static void regulator_ena_gpio_free(struct regulator_dev *rdev)
gpio_free(pin->gpio);
list_del(&pin->list);
kfree(pin);
+ rdev->ena_pin = NULL;
+ return;
} else {
pin->request_count--;
}