MIPS: Loongson64: Add of_node_put() before break
authorWan Jiabing <wanjiabing@vivo.com>
Fri, 15 Oct 2021 07:01:22 +0000 (03:01 -0400)
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>
Mon, 18 Oct 2021 16:12:57 +0000 (18:12 +0200)
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>
arch/mips/loongson64/init.c

index 76e0a96..f03fc52 100644 (file)
@@ -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;
                }