perf: RISC-V: Add of_node_put() when breaking out of for_each_of_cpu_node()
Subsystems (3)
PATCH 1/1 perf: RISC-V: Add of_node_put() when breaking out of for_each_of_cpu_node()
In pmu_sbi_setup_irqs(), we should call of_node_put() for the 'cpu' when breaking out of for_each_of_cput_node() as its refcount will be automatically increased and decreased during the iteration.
--- drivers/perf/riscv_pmu_sbi.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/perf/riscv_pmu_sbi.c +4 -1
@@ -666,12 +666,15 @@ static int pmu_sbi_setup_irqs(struct riscv_pmu *pmu, struct platform_device *pde child =of_get_compatible_child (cpu,"riscv,cpu-intc" );if (!child) {pr_err ("Failed to find INTC node\n" ); +of_node_put (cpu);return -ENODEV ; } domain =irq_find_host (child);of_node_put (child); -if (domain) +if (domain) { +of_node_put (cpu);break ; + } }if (!domain) {pr_err ("Failed to find INTC IRQ root domain\n" );
Signature · 7 lines
2.25.1 _______________________________________________ linux-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-riscv
Quoted 34 lines · Liang He
In
pmu_sbi_setup_irqs(), we should callof_node_put()for the 'cpu' when breaking out offor_each_of_cput_node()as its refcount will be automatically increased and decreased during the iteration.Fixes 4905ec2fb7e6 ("RISC-V: Add sscofpmf extension support")Signed-off-by Liang He <[email protected]>--- drivers/perf/riscv_pmu_sbi.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)drivers/perf/riscv_pmu_sbi.c +4
-1@@ -666,12 +666,15 @@ static int pmu_sbi_setup_irqs(struct riscv_pmu *pmu, struct platform_device *pde child =of_get_compatible_child (cpu,"riscv,cpu-intc" );if (!child) {pr_err ("Failed to find INTC node\n" ); +of_node_put (cpu);return -ENODEV ; } domain =irq_find_host (child);of_node_put (child); -if (domain) +if (domain) { +of_node_put (cpu);break ; + } }if (!domain) {pr_err ("Failed to find INTC IRQ root domain\n" );Signature · 1 line
2.25.1
_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
Quoted 33 lines · Liang He
In
pmu_sbi_setup_irqs(), we should callof_node_put()for the 'cpu' when breaking out offor_each_of_cput_node()as its refcount will be automatically increased and decreased during the iteration.Fixes 4905ec2fb7e6 ("RISC-V: Add sscofpmf extension support")Signed-off-by Liang He <[email protected]>--- drivers/perf/riscv_pmu_sbi.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)drivers/perf/riscv_pmu_sbi.c +4
-2@@ -666,12 +666,15 @@ static int pmu_sbi_setup_irqs(struct riscv_pmu *pmu, struct platform_device *pde child =of_get_compatible_child (cpu,"riscv,cpu-intc" );if (!child) {pr_err ("Failed to find INTC node\n" ); +of_node_put (cpu);return -ENODEV ; } domain =irq_find_host (child);of_node_put (child); -if (domain) +if (domain) { +of_node_put (cpu);break ; + } }if (!domain) {pr_err ("Failed to find INTC IRQ root domain\n" ); --
Quoted 2 lines
2.25.1
Thanks for catching it.
Signature · 7 lines
Regards, Atish _______________________________________________ linux-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-riscv
Quoted 5 lines · Liang He
In
pmu_sbi_setup_irqs(), we should callof_node_put()for the 'cpu' when breaking out offor_each_of_cput_node()as its refcount will be automatically increased and decreased during the iteration.
Applied to will (for-next/perf), thanks!
[1/1] perf: RISC-V: Add of_node_put() when breaking out of for_each_of_cpu_node()
https://git.kernel.org/will/c/491f10d08fda
Cheers,
Signature · 10 lines
Will https://fixes.arm64.dev https://next.arm64.dev https://will.arm64.dev _______________________________________________ linux-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-riscv