Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1636590

[PATCH 3.18 38/68] regulator: core: Fix regualtor_ena_gpio_free not to access pin after freeing

From Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Newsgroups linux.kernel
Subject [PATCH 3.18 38/68] regulator: core: Fix regualtor_ena_gpio_free not to access pin after freeing
Date 2017-05-05 20:40 +0200
Message-ID <tDQj2-5qv-85@gated-at.bofh.it> (permalink)
References <tDQj0-5qv-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


3.18-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Seung-Woo Kim <sw0312.kim@samsung.com>

commit 60a2362f769cf549dc466134efe71c8bf9fbaaba upstream.

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>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/regulator/core.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1720,6 +1720,8 @@ static void regulator_ena_gpio_free(stru
 				gpiod_put(pin->gpiod);
 				list_del(&pin->list);
 				kfree(pin);
+				rdev->ena_pin = NULL;
+				return;
 			} else {
 				pin->request_count--;
 			}

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH 3.18 38/68] regulator: core: Fix regualtor_ena_gpio_free not to access pin after freeing Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-05-05 20:40 +0200

csiph-web