[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230907095521.14053-7-Julia.Lawall@inria.fr>
Date: Thu, 7 Sep 2023 11:55:16 +0200
From: Julia Lawall <Julia.Lawall@...ia.fr>
To: Michael Ellerman <mpe@...erman.id.au>
Cc: kernel-janitors@...r.kernel.org,
Nicholas Piggin <npiggin@...il.com>,
Christophe Leroy <christophe.leroy@...roup.eu>,
linuxppc-dev@...ts.ozlabs.org, linux-kernel@...r.kernel.org
Subject: [PATCH 06/11] powerpc/kexec_file: add missing of_node_put
for_each_node_with_property performs an of_node_get on each
iteration, so a break out of the loop requires an
of_node_put.
This was done using the Coccinelle semantic patch
iterators/for_each_child.cocci
Signed-off-by: Julia Lawall <Julia.Lawall@...ia.fr>
---
arch/powerpc/kexec/file_load_64.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff -u -p a/arch/powerpc/kexec/file_load_64.c b/arch/powerpc/kexec/file_load_64.c
--- a/arch/powerpc/kexec/file_load_64.c
+++ b/arch/powerpc/kexec/file_load_64.c
@@ -1138,11 +1138,15 @@ static int update_pci_dma_nodes(void *fd
continue;
ret = copy_property(fdt, pci_offset, dn, "ibm,dma-window");
- if (ret < 0)
+ if (ret < 0) {
+ of_node_put(dn);
break;
+ }
ret = copy_property(fdt, pci_offset, dn, dmapropname);
- if (ret < 0)
+ if (ret < 0) {
+ of_node_put(dn);
break;
+ }
}
return ret;
Powered by blists - more mailing lists