Skip to content

Commit

Permalink
MIPS: Loongson64: Add of_node_put() before break
Browse files Browse the repository at this point in the history
Fix following coccicheck warning:
./arch/mips/loongson64/init.c:174:1-22: WARNING: Function
for_each_node_by_name should have of_node_put() before break

Early exits from for_each_node_by_name should decrement the
node reference counter.

Signed-off-by: Wan Jiabing <wanjiabing@vivo.com>
Reviewed-by: Huacai Chen <chenhuacai@kernel.org>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
  • Loading branch information
Wan Jiabing authored and Thomas Bogendoerfer committed Oct 18, 2021
1 parent 4beaeb5 commit 169dd5f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions arch/mips/loongson64/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ static __init void reserve_pio_range(void)

if (of_range_parser_init(&parser, np)) {
pr_info("Failed to parse resources.\n");
of_node_put(np);
break;
}

Expand Down

0 comments on commit 169dd5f

Please sign in to comment.