lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Sat, 7 May 2022 16:25:26 +0800
From:   Wei Xu <xuwei5@...ilicon.com>
To:     Peng Wu <wupeng58@...wei.com>, <linux@...linux.org.uk>
CC:     <linux-arm-kernel@...ts.infradead.org>,
        <linux-kernel@...r.kernel.org>, <liwei391@...wei.com>,
        <wangxiongfeng2@...wei.com>, <xuwei5@...ilicon.com>
Subject: Re: [PATCH] ARM: hisi: Add missing of_node_put after of_find_compatible_node

Hi Peng,

On 2022/4/28 18:43, Peng Wu wrote:
> of_find_compatible_node  will increment the refcount of the returned
> device_node. Calling of_node_put() to avoid the refcount leak
> 
> Signed-off-by: Peng Wu <wupeng58@...wei.com>

Thanks!
Applied to the hisilicon armv7 SoC tree.

Best Regards,
Wei

> ---
>  arch/arm/mach-hisi/platsmp.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/arch/arm/mach-hisi/platsmp.c b/arch/arm/mach-hisi/platsmp.c
> index a56cc64deeb8..9ce93e0b6cdc 100644
> --- a/arch/arm/mach-hisi/platsmp.c
> +++ b/arch/arm/mach-hisi/platsmp.c
> @@ -67,14 +67,17 @@ static void __init hi3xxx_smp_prepare_cpus(unsigned int max_cpus)
>  		}
>  		ctrl_base = of_iomap(np, 0);
>  		if (!ctrl_base) {
> +			of_node_put(np);
>  			pr_err("failed to map address\n");
>  			return;
>  		}
>  		if (of_property_read_u32(np, "smp-offset", &offset) < 0) {
> +			of_node_put(np);
>  			pr_err("failed to find smp-offset property\n");
>  			return;
>  		}
>  		ctrl_base += offset;
> +		of_node_put(np);
>  	}
>  }
>  
> @@ -160,6 +163,7 @@ static int hip01_boot_secondary(unsigned int cpu, struct task_struct *idle)
>  	if (WARN_ON(!node))
>  		return -1;
>  	ctrl_base = of_iomap(node, 0);
> +	of_node_put(node);
>  
>  	/* set the secondary core boot from DDR */
>  	remap_reg_value = readl_relaxed(ctrl_base + REG_SC_CTRL);
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ