Message ID | 20200218094234.23896-8-brgl@bgdev.pl |
---|---|
State | New |
Headers | show |
Series | nvmem/gpio: fix resource management | expand |
diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index 5e7d46eccaf6..ec955db4673c 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -346,6 +346,7 @@ struct nvmem_device *nvmem_register(const struct nvmem_config *config) rval = ida_simple_get(&nvmem_ida, 0, 0, GFP_KERNEL); if (rval < 0) goto err_free_nvmem; + if (config->wp_gpio) nvmem->wp_gpio = gpiod_ref(config->wp_gpio); else