From: Linus Walleij Date: Sat, 20 Apr 2019 11:34:30 +0000 (+0200) Subject: regulator: core: Actually put the gpiod after use X-Git-Tag: Ubuntu-5.4-5.4.0-11.14~3007^2~1^2~1 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=78927aa40bc82f32de07323ddc1c9de07ac68180;p=mirror_ubuntu-focal-kernel.git regulator: core: Actually put the gpiod after use I went to great lengths to hand over the management of the GPIO descriptors to the regulator core, and some stray rebased oneliner in the old patch must have been assuming the devices were still doing devres management of it. We handed the management over to the regulator core, so of course the regulator core shall issue gpiod_put() when done. Sorry for the descriptor leak. Fixes: 541d052d7215 ("regulator: core: Only support passing enable GPIO descriptors") Signed-off-by: Linus Walleij Signed-off-by: Mark Brown --- diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 8573dd0871fd..35a7d020afec 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -2256,6 +2256,7 @@ static void regulator_ena_gpio_free(struct regulator_dev *rdev) if (pin->gpiod == rdev->ena_pin->gpiod) { if (pin->request_count <= 1) { pin->request_count = 0; + gpiod_put(pin->gpiod); list_del(&pin->list); kfree(pin); rdev->ena_pin = NULL;