Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752039AbdIVKxz (ORCPT ); Fri, 22 Sep 2017 06:53:55 -0400 Received: from foss.arm.com ([217.140.101.70]:56148 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751903AbdIVKxx (ORCPT ); Fri, 22 Sep 2017 06:53:53 -0400 Date: Fri, 22 Sep 2017 11:54:06 +0100 From: Will Deacon To: Arvind Yadav , catalin.marinas@arm.com Cc: mark.rutland@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drivers/perf: arm_pmu_acpi: Release memory obtained by kasprintf Message-ID: <20170922105405.GD23365@arm.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 924 Lines: 29 On Wed, Sep 20, 2017 at 12:26:38PM +0530, Arvind Yadav wrote: > Free memory region, if arm_pmu_acpi_probe is not successful. > > Signed-off-by: Arvind Yadav > --- > drivers/perf/arm_pmu_acpi.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/perf/arm_pmu_acpi.c b/drivers/perf/arm_pmu_acpi.c > index 0a9b787..3303dd8 100644 > --- a/drivers/perf/arm_pmu_acpi.c > +++ b/drivers/perf/arm_pmu_acpi.c > @@ -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; > } > } It's a bit weird that we bail out of the loop on the first failing CPU, but you've not changed that behaviour so your patch looks fine in isolation: Acked-by: Will Deacon Catalin: can you pick this up as a fix, please? Will