Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 60a2362f authored by Seung-Woo Kim's avatar Seung-Woo Kim Committed by Mark Brown
Browse files

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: default avatarSeung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 194dbaef
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -1713,6 +1713,8 @@ static void regulator_ena_gpio_free(struct regulator_dev *rdev)
				gpiod_put(pin->gpiod);
				gpiod_put(pin->gpiod);
				list_del(&pin->list);
				list_del(&pin->list);
				kfree(pin);
				kfree(pin);
				rdev->ena_pin = NULL;
				return;
			} else {
			} else {
				pin->request_count--;
				pin->request_count--;
			}
			}