drivers/perf: arm_pmu_acpi: Release memory obtained by kasprintf
authorArvind Yadav <arvind.yadav.cs@gmail.com>
Wed, 20 Sep 2017 06:56:38 +0000 (12:26 +0530)
committerCatalin Marinas <catalin.marinas@arm.com>
Fri, 22 Sep 2017 14:11:46 +0000 (15:11 +0100)
Free memory region, if arm_pmu_acpi_probe is not successful.

Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
drivers/perf/arm_pmu_acpi.c

index 0a9b787..3303dd8 100644 (file)
@@ -235,6 +235,7 @@ int arm_pmu_acpi_probe(armpmu_init_fn init_fn)
                ret = armpmu_register(pmu);
                if (ret) {
                        pr_warn("Failed to register PMU for CPU%d\n", cpu);
+                       kfree(pmu->name);
                        return ret;
                }
        }