* [PATCH] regulator: core: Fix regualtor_ena_gpio_free not to access pin after freeing
@ 2014-12-04 10:17 Seung-Woo Kim
2014-12-04 22:45 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Seung-Woo Kim @ 2014-12-04 10:17 UTC (permalink / raw)
To: lgirdwood, broonie, linux-kernel; +Cc: sw0312.kim
After freeing pin from regulator_ena_gpio_free, loop can access
the pin. So this patch fixes not to access pin after freeing.
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
---
drivers/regulator/core.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index cd87c0c..479ef0b 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1713,6 +1713,8 @@ static void regulator_ena_gpio_free(struct regulator_dev *rdev)
gpiod_put(pin->gpiod);
list_del(&pin->list);
kfree(pin);
+ rdev->ena_pin = NULL;
+ return;
} else {
pin->request_count--;
}
--
1.7.4.1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-12-04 22:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-04 10:17 [PATCH] regulator: core: Fix regualtor_ena_gpio_free not to access pin after freeing Seung-Woo Kim
2014-12-04 22:45 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®