Commit 7453f501 authored by Wan Jiabing's avatar Wan Jiabing Committed by Michael Ellerman
Browse files

powerpc/kexec_file: Add of_node_put() before goto



Fix following coccicheck warning:
./arch/powerpc/kexec/file_load_64.c:698:1-22: WARNING: Function
for_each_node_by_type should have of_node_put() before goto

Early exits from for_each_node_by_type should decrement the
node reference counter.

Signed-off-by: default avatarWan Jiabing <wanjiabing@vivo.com>
Acked-by: default avatarHari Bathini <hbathini@linux.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20211018015418.10182-1-wanjiabing@vivo.com
parent 915b368f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -700,6 +700,7 @@ static int update_usable_mem_fdt(void *fdt, struct crash_mem *usable_mem)
		if (ret) {
			pr_err("Failed to set linux,usable-memory property for %s node",
			       dn->full_name);
			of_node_put(dn);
			goto out;
		}
	}