Skip to content

Commit

Permalink
mips: cpc: Fix refcount leak in mips_cpc_default_phys_base
Browse files Browse the repository at this point in the history
[ Upstream commit 4107fa7 ]

Add the missing of_node_put() to release the refcount incremented
by of_find_compatible_node().

Signed-off-by: Gong Yuanjun <ruc_gongyuanjun@163.com>
Reviewed-by: Serge Semin <fancer.lancer@gmail.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
AnnYugawa authored and gregkh committed Jun 14, 2022
1 parent 76b226e commit c667b38
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions arch/mips/kernel/mips-cpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ phys_addr_t __weak mips_cpc_default_phys_base(void)
cpc_node = of_find_compatible_node(of_root, NULL, "mti,mips-cpc");
if (cpc_node) {
err = of_address_to_resource(cpc_node, 0, &res);
of_node_put(cpc_node);
if (!err)
return res.start;
}
Expand Down

0 comments on commit c667b38

Please sign in to comment.