Skip to content

Commit 60a2362

Browse files
devusr-sw-kimbroonie
authored andcommitted
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. Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 194dbae commit 60a2362

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Diff for: drivers/regulator/core.c

+2
Original file line numberDiff line numberDiff line change
@@ -1713,6 +1713,8 @@ static void regulator_ena_gpio_free(struct regulator_dev *rdev)
17131713
gpiod_put(pin->gpiod);
17141714
list_del(&pin->list);
17151715
kfree(pin);
1716+
rdev->ena_pin = NULL;
1717+
return;
17161718
} else {
17171719
pin->request_count--;
17181720
}

0 commit comments

Comments
 (0)