lkml.org 
[lkml]   [2021]   [Oct]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] powerpc/kexec_file: Add of_node_put() before goto
From


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;
> }
> }
>

\
 
 \ /
  Last update: 2021-10-18 09:08    [W:0.059 / U:0.316 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site