* [PATCH] powerpc/kexec_file: Add of_node_put() before goto
@ 2021-10-18 1:54 Wan Jiabing
2021-10-18 7:07 ` Hari Bathini
2021-11-02 10:11 ` Michael Ellerman
0 siblings, 2 replies; 3+ messages in thread
From: Wan Jiabing @ 2021-10-18 1:54 UTC (permalink / raw)
To: Michael Ellerman, Benjamin Herrenschmidt, Paul Mackerras,
Rob Herring, Thiago Jung Bauermann, Lakshmi Ramasubramanian,
Hari Bathini, Wan Jiabing, Sourabh Jain, linuxppc-dev,
linux-kernel
Cc: kael_w
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: Wan Jiabing <wanjiabing@vivo.com>
---
arch/powerpc/kexec/file_load_64.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/powerpc/kexec/file_load_64.c b/arch/powerpc/kexec/file_load_64.c
index 5056e175ca2c..b4981b651d9a 100644
--- a/arch/powerpc/kexec/file_load_64.c
+++ b/arch/powerpc/kexec/file_load_64.c
@@ -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;
}
}
--
2.20.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] powerpc/kexec_file: Add of_node_put() before goto
2021-10-18 1:54 [PATCH] powerpc/kexec_file: Add of_node_put() before goto Wan Jiabing
@ 2021-10-18 7:07 ` Hari Bathini
2021-11-02 10:11 ` Michael Ellerman
1 sibling, 0 replies; 3+ messages in thread
From: Hari Bathini @ 2021-10-18 7:07 UTC (permalink / raw)
To: Wan Jiabing, Michael Ellerman, Benjamin Herrenschmidt,
Paul Mackerras, Rob Herring, Thiago Jung Bauermann,
Lakshmi Ramasubramanian, Sourabh Jain, linuxppc-dev,
linux-kernel
Cc: kael_w
On 18/10/21 7:24 am, Wan Jiabing wrote:
> 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: Wan Jiabing <wanjiabing@vivo.com>
Thanks for fixing this!
Acked-by: Hari Bathini <hbathini@linux.ibm.com>
> ---
> arch/powerpc/kexec/file_load_64.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/arch/powerpc/kexec/file_load_64.c b/arch/powerpc/kexec/file_load_64.c
> index 5056e175ca2c..b4981b651d9a 100644
> --- a/arch/powerpc/kexec/file_load_64.c
> +++ b/arch/powerpc/kexec/file_load_64.c
> @@ -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;
> }
> }
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] powerpc/kexec_file: Add of_node_put() before goto
2021-10-18 1:54 [PATCH] powerpc/kexec_file: Add of_node_put() before goto Wan Jiabing
2021-10-18 7:07 ` Hari Bathini
@ 2021-11-02 10:11 ` Michael Ellerman
1 sibling, 0 replies; 3+ messages in thread
From: Michael Ellerman @ 2021-11-02 10:11 UTC (permalink / raw)
To: Wan Jiabing, linux-kernel, Paul Mackerras, Michael Ellerman,
Lakshmi Ramasubramanian, Sourabh Jain, Hari Bathini,
linuxppc-dev, Rob Herring, Thiago Jung Bauermann,
Benjamin Herrenschmidt
Cc: kael_w
On Sun, 17 Oct 2021 21:54:16 -0400, Wan Jiabing wrote:
> 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.
>
> [...]
Applied to powerpc/next.
[1/1] powerpc/kexec_file: Add of_node_put() before goto
https://git.kernel.org/powerpc/c/7453f501d443c7febf48809ee1c530b64d625c59
cheers
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-11-02 11:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-18 1:54 [PATCH] powerpc/kexec_file: Add of_node_put() before goto Wan Jiabing
2021-10-18 7:07 ` Hari Bathini
2021-11-02 10:11 ` Michael Ellerman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).