Message ID | 20200219092218.18143-7-brgl@bgdev.pl |
---|---|
State | Superseded |
Headers | show |
Series | [v3,1/7] nvmem: fix memory leak in error path | expand |
diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index bbdf2fe076b9..40fe5913c264 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -348,6 +348,7 @@ struct nvmem_device *nvmem_register(const struct nvmem_config *config) kfree(nvmem); return ERR_PTR(rval); } + if (config->wp_gpio) nvmem->wp_gpio = gpiod_ref(config->wp_gpio); else