Commit 4528668c authored by Miaoqian Lin's avatar Miaoqian Lin Committed by Thomas Bogendoerfer

mips: cdmm: Fix refcount leak in mips_cdmm_phys_base

The of_find_compatible_node() function returns a node pointer with
refcount incremented, We should use of_node_put() on it when done
Add the missing of_node_put() to release the refcount.

Fixes: 2121aa3e ("mips: cdmm: Add mti,mips-cdmm dtb node support")
Signed-off-by: default avatarMiaoqian Lin <linmq006@gmail.com>
Acked-by: default avatarSerge Semin <fancer.lancer@gmail.com>
Signed-off-by: default avatarThomas Bogendoerfer <tsbogend@alpha.franken.de>
parent 3f059a7e
...@@ -351,6 +351,7 @@ phys_addr_t __weak mips_cdmm_phys_base(void) ...@@ -351,6 +351,7 @@ phys_addr_t __weak mips_cdmm_phys_base(void)
np = of_find_compatible_node(NULL, NULL, "mti,mips-cdmm"); np = of_find_compatible_node(NULL, NULL, "mti,mips-cdmm");
if (np) { if (np) {
err = of_address_to_resource(np, 0, &res); err = of_address_to_resource(np, 0, &res);
of_node_put(np);
if (!err) if (!err)
return res.start; return res.start;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment