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] [thread-next>] [day] [month] [year] [list]
Message-ID: <efea6d1d-afee-4e80-94d0-1ca99f9dc9c2@arm.com>
Date: Thu, 1 Aug 2024 16:41:15 +0530
From: Anshuman Khandual <anshuman.khandual@....com>
To: "Rob Herring (Arm)" <robh@...nel.org>, Will Deacon <will@...nel.org>,
 Mark Rutland <mark.rutland@....com>
Cc: linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] perf: arm_pmu: Use of_property_present()

On 8/1/24 00:42, Rob Herring (Arm) wrote:
> Use of_property_present() to test for property presence rather than
> of_find_property(). This is part of a larger effort to remove callers
> of of_find_property() and similar functions. of_find_property() leaks
> the DT struct property and data pointers which is a problem for
> dynamically allocated nodes which may be freed.
> 
> Signed-off-by: Rob Herring (Arm) <robh@...nel.org>
> ---
>  drivers/perf/arm_pmu_platform.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/perf/arm_pmu_platform.c b/drivers/perf/arm_pmu_platform.c
> index 4b1a9a92ea11..118170a5cede 100644
> --- a/drivers/perf/arm_pmu_platform.c
> +++ b/drivers/perf/arm_pmu_platform.c
> @@ -59,7 +59,7 @@ static int pmu_parse_percpu_irq(struct arm_pmu *pmu, int irq)
>  
>  static bool pmu_has_irq_affinity(struct device_node *node)
>  {
> -	return !!of_find_property(node, "interrupt-affinity", NULL);
> +	return of_property_present(node, "interrupt-affinity");
>  }
>  
>  static int pmu_parse_irq_affinity(struct device *dev, int i)

After this change there are no of_find_property() instances left
in the drivers/perf directory.

Reviewed-by: Anshuman Khandual <anshuman.khandual@....com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ