Message ID | 20200217195435.9309-6-brgl@bgdev.pl |
---|---|
State | New |
Headers | show |
Series | None | expand |
diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index 07af9edea9cf..096c7bae9e74 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -72,6 +72,7 @@ static void nvmem_release(struct device *dev) struct nvmem_device *nvmem = to_nvmem_device(dev); ida_simple_remove(&nvmem_ida, nvmem->id); + gpiod_put(nvmem->wp_gpio); kfree(nvmem); } @@ -430,6 +431,7 @@ struct nvmem_device *nvmem_register(const struct nvmem_config *config) device_del(&nvmem->dev); err_put_device: put_device(&nvmem->dev); + gpiod_put(nvmem->wp_gpio); err_ida_remove: ida_simple_remove(&nvmem_ida, nvmem->id);