Skip to content

Commit 48ca54e

Browse files
windhltsbogend
authored andcommitted
mips: ralink: Fix refcount leak in of.c
In plat_of_remap_node(), plat_of_remap_node() will return a node pointer with refcount incremented. We should use of_node_put() when it is not used anymore. Signed-off-by: Liang He <[email protected]> Signed-off-by: Thomas Bogendoerfer <[email protected]>
1 parent 608d94c commit 48ca54e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

arch/mips/ralink/of.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ __iomem void *plat_of_remap_node(const char *node)
4040
if (of_address_to_resource(np, 0, &res))
4141
panic("Failed to get resource for %s", node);
4242

43+
of_node_put(np);
44+
4345
if (!request_mem_region(res.start,
4446
resource_size(&res),
4547
res.name))

0 commit comments

Comments
 (0)