Message ID | 20200220100141.5905-4-brgl@bgdev.pl |
---|---|
State | New |
Headers | show |
Series | [v4,1/4] nvmem: fix memory leak in error path | expand |
diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index 948c7ebce340..071fb897394c 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -349,7 +349,7 @@ struct nvmem_device *nvmem_register(const struct nvmem_config *config) } if (config->wp_gpio) - nvmem->wp_gpio = config->wp_gpio; + nvmem->wp_gpio = gpiod_ref(config->wp_gpio); else nvmem->wp_gpio = gpiod_get_optional(config->dev, "wp", GPIOD_OUT_HIGH);