summaryrefslogtreecommitdiffstats
path: root/drivers/perf
diff options
context:
space:
mode:
authorJulien Grall <julien.grall@arm.com>2016-05-31 13:41:23 +0200
committerWill Deacon <will.deacon@arm.com>2016-06-03 11:16:21 +0200
commit5988a363edb9eb9f31486ceb2cd10e8b45f05dda (patch)
treee8c67f24348f9490a62d24d4125b30a2dae87791 /drivers/perf
parentdrivers/perf: arm_pmu: Defer the setting of __oprofile_cpu_pmu (diff)
downloadlinux-5988a363edb9eb9f31486ceb2cd10e8b45f05dda.tar.xz
linux-5988a363edb9eb9f31486ceb2cd10e8b45f05dda.zip
drivers/perf: arm_pmu: Avoid leaking pmu->irq_affinity on error
pmu->irq_affinity will not be freed if an error occurred within arm_pmu_device_probe after of_pmu_irq_cfg has been called. Note that in the case of_pmu_irq_cfg is returning an error, pmu->irq_affinity will not be set, but it should be NULL as pmu was kzalloc'd. Therefore the result kfree(NULL) is benign. Signed-off-by: Julien Grall <julien.grall@arm.com> Acked-by: Mark Rutland <mark.rutland@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'drivers/perf')
-rw-r--r--drivers/perf/arm_pmu.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/perf/arm_pmu.c b/drivers/perf/arm_pmu.c
index 95614d24675f..1b8304e1efaa 100644
--- a/drivers/perf/arm_pmu.c
+++ b/drivers/perf/arm_pmu.c
@@ -1040,6 +1040,7 @@ out_destroy:
out_free:
pr_info("%s: failed to register PMU devices!\n",
of_node_full_name(node));
+ kfree(pmu->irq_affinity);
kfree(pmu);
return ret;
}