* [PATCH RESEND] drivers/perf: arm_pmu: avoid CPU device_node reference leak
@ 2015-10-12 13:48 Will Deacon
2015-10-15 13:18 ` Will Deacon
2015-10-15 15:12 ` Arnd Bergmann
0 siblings, 2 replies; 3+ messages in thread
From: Will Deacon @ 2015-10-12 13:48 UTC (permalink / raw)
To: linux-arm-kernel
of_cpu_device_node_get increments the reference count on the CPU
device_node, so we must take care to of_node_put once we've finished
with it.
This patch fixes the perf IRQ probing code to avoid the leak.
Cc: Sudeep Holla <sudeep.holla@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
Arnd/Olof: Please can you take this via arm-soc? It's a non-urgent, yet
simple fix and I don't have any other fixes queued for perf.
drivers/perf/arm_pmu.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/perf/arm_pmu.c b/drivers/perf/arm_pmu.c
index 2365a32a595e..be3755c973e9 100644
--- a/drivers/perf/arm_pmu.c
+++ b/drivers/perf/arm_pmu.c
@@ -823,9 +823,15 @@ static int of_pmu_irq_cfg(struct arm_pmu *pmu)
}
/* Now look up the logical CPU number */
- for_each_possible_cpu(cpu)
- if (dn == of_cpu_device_node_get(cpu))
+ for_each_possible_cpu(cpu) {
+ struct device_node *cpu_dn;
+
+ cpu_dn = of_cpu_device_node_get(cpu);
+ of_node_put(cpu_dn);
+
+ if (dn == cpu_dn)
break;
+ }
if (cpu >= nr_cpu_ids) {
pr_warn("Failed to find logical CPU for %s\n",
--
2.1.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH RESEND] drivers/perf: arm_pmu: avoid CPU device_node reference leak
2015-10-12 13:48 [PATCH RESEND] drivers/perf: arm_pmu: avoid CPU device_node reference leak Will Deacon
@ 2015-10-15 13:18 ` Will Deacon
2015-10-15 15:12 ` Arnd Bergmann
1 sibling, 0 replies; 3+ messages in thread
From: Will Deacon @ 2015-10-15 13:18 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Oct 12, 2015 at 02:48:39PM +0100, Will Deacon wrote:
> of_cpu_device_node_get increments the reference count on the CPU
> device_node, so we must take care to of_node_put once we've finished
> with it.
>
> This patch fixes the perf IRQ probing code to avoid the leak.
>
> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Mark Rutland <mark.rutland@arm.com>
> Signed-off-by: Will Deacon <will.deacon@arm.com>
> ---
>
> Arnd/Olof: Please can you take this via arm-soc? It's a non-urgent, yet
> simple fix and I don't have any other fixes queued for perf.
Ping? I can't see this queued in arm-soc and I'm away next week, so just
following up while I can.
Will
> drivers/perf/arm_pmu.c | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/perf/arm_pmu.c b/drivers/perf/arm_pmu.c
> index 2365a32a595e..be3755c973e9 100644
> --- a/drivers/perf/arm_pmu.c
> +++ b/drivers/perf/arm_pmu.c
> @@ -823,9 +823,15 @@ static int of_pmu_irq_cfg(struct arm_pmu *pmu)
> }
>
> /* Now look up the logical CPU number */
> - for_each_possible_cpu(cpu)
> - if (dn == of_cpu_device_node_get(cpu))
> + for_each_possible_cpu(cpu) {
> + struct device_node *cpu_dn;
> +
> + cpu_dn = of_cpu_device_node_get(cpu);
> + of_node_put(cpu_dn);
> +
> + if (dn == cpu_dn)
> break;
> + }
>
> if (cpu >= nr_cpu_ids) {
> pr_warn("Failed to find logical CPU for %s\n",
> --
> 2.1.4
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH RESEND] drivers/perf: arm_pmu: avoid CPU device_node reference leak
2015-10-12 13:48 [PATCH RESEND] drivers/perf: arm_pmu: avoid CPU device_node reference leak Will Deacon
2015-10-15 13:18 ` Will Deacon
@ 2015-10-15 15:12 ` Arnd Bergmann
1 sibling, 0 replies; 3+ messages in thread
From: Arnd Bergmann @ 2015-10-15 15:12 UTC (permalink / raw)
To: linux-arm-kernel
On Monday 12 October 2015 14:48:39 Will Deacon wrote:
> of_cpu_device_node_get increments the reference count on the CPU
> device_node, so we must take care to of_node_put once we've finished
> with it.
>
> This patch fixes the perf IRQ probing code to avoid the leak.
>
> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Mark Rutland <mark.rutland@arm.com>
> Signed-off-by: Will Deacon <will.deacon@arm.com>
> ---
>
> Arnd/Olof: Please can you take this via arm-soc? It's a non-urgent, yet
> simple fix and I don't have any other fixes queued for perf.
>
Seems still appropriate for 4.3, so I've put it into the fixes branch.
Thanks for the reminder,
Arnd
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-10-15 15:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-12 13:48 [PATCH RESEND] drivers/perf: arm_pmu: avoid CPU device_node reference leak Will Deacon
2015-10-15 13:18 ` Will Deacon
2015-10-15 15:12 ` Arnd Bergmann
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.