Skip to content

Commit 4528668

Browse files
Yuuoniytsbogend
authored andcommitted
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: 2121aa3 ("mips: cdmm: Add mti,mips-cdmm dtb node support") Signed-off-by: Miaoqian Lin <linmq006@gmail.com> Acked-by: Serge Semin <fancer.lancer@gmail.com> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
1 parent 3f059a7 commit 4528668

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

drivers/bus/mips_cdmm.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,7 @@ phys_addr_t __weak mips_cdmm_phys_base(void)
351351
np = of_find_compatible_node(NULL, NULL, "mti,mips-cdmm");
352352
if (np) {
353353
err = of_address_to_resource(np, 0, &res);
354+
of_node_put(np);
354355
if (!err)
355356
return res.start;
356357
}

0 commit comments

Comments
 (0)