Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

nvmem: add missing of_node_put() in of_nvmem_cell_get()

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Masahiro Yamada and committed by
Greg Kroah-Hartman
aad8d097 38b0774c

+1
+1
drivers/nvmem/core.c
··· 789 789 return ERR_PTR(-EINVAL); 790 790 791 791 nvmem = __nvmem_device_get(nvmem_np, NULL, NULL); 792 + of_node_put(nvmem_np); 792 793 if (IS_ERR(nvmem)) 793 794 return ERR_CAST(nvmem); 794 795