瀏覽代碼

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>
Masahiro Yamada 8 年之前
父節點
當前提交
aad8d097c9
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      drivers/nvmem/core.c

+ 1 - 0
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);