[2/4] nvmem: add missing of_node_put() in of_nvmem_cell_get()

Message ID 20170911090014.16806-3-srinivas.kandagatla@linaro.org
State New
Headers show
Series
  • nvmem: set2 patches for v4.14
Related show

Commit Message

Srinivas Kandagatla Sept. 11, 2017, 9 a.m.
From: Masahiro Yamada <yamada.masahiro@socionext.com>


of_get_next_parent() increments the refcount of the returned node.
It should be put when done.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

---
 drivers/nvmem/core.c | 1 +
 1 file changed, 1 insertion(+)

-- 
2.9.3

Patch

diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
index 3866117..d12e5de 100644
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -789,6 +789,7 @@  struct nvmem_cell *of_nvmem_cell_get(struct device_node *np,
 		return ERR_PTR(-EINVAL);
 
 	nvmem = __nvmem_device_get(nvmem_np, NULL, NULL);
+	of_node_put(nvmem_np);
 	if (IS_ERR(nvmem))
 		return ERR_CAST(nvmem);