From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0AE09C4332F for ; Tue, 15 Nov 2022 11:45:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:To:Subject:MIME-Version: Date:Message-ID:Reply-To:Cc:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=5xiXMNcg+0DNajmYmnsnhDc/8ow+eqknuebs6z06K4M=; b=SwkrFNTL8KxWfb761r8qbxJwv5 6MT0kZSpY69TYE7gSqZRJdqDnIq4Rj1LHUYjteo7J5GCurlr4C+3S5T3lHOFZA3SG6P7UXBLX+1WO qdnLkBIz8v+ZsB1cLNHAM9sybbswYCeUO046eikxrwzXmrh/WFu6qxXZaBzmLVXieTVWKLYISkYGy pdXJJzNJWivJVh3KApOkczmjTB39o0PMi8LhjRGXPcwVcJ5D8W54dDtuiouTLpLx5ZLdTGbjEkli/ FY40NmLBThDAqEnjR7W5fsaBpeyDmjH2eYbDB0T3ZvIyfxmDUZP6doKOZXh9QRmYZXdPJlIneBA9m XhquwDGQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ouuMR-00Agvn-VN; Tue, 15 Nov 2022 11:44:16 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ouuMN-00AgtP-Hh for linux-arm-kernel@lists.infradead.org; Tue, 15 Nov 2022 11:44:13 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9748A13D5; Tue, 15 Nov 2022 03:44:12 -0800 (PST) Received: from [10.57.37.3] (unknown [10.57.37.3]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 547B73F73B; Tue, 15 Nov 2022 03:44:05 -0800 (PST) Message-ID: <8ce05a37-be97-31f8-ae5f-cd4a63147656@arm.com> Date: Tue, 15 Nov 2022 11:44:03 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH 1/2] perf: arm_dsu: Fix hotplug callback leak in dsu_pmu_init() To: Yuan Can , will@kernel.org, mark.rutland@arm.com, bbudiredla@marvell.com, Jonathan.Cameron@huawei.com, linux-arm-kernel@lists.infradead.org References: <20221115070207.32634-1-yuancan@huawei.com> <20221115070207.32634-2-yuancan@huawei.com> From: Suzuki K Poulose In-Reply-To: <20221115070207.32634-2-yuancan@huawei.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221115_034411_665256_C755D5C6 X-CRM114-Status: GOOD ( 15.90 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 15/11/2022 07:02, Yuan Can wrote: > dsu_pmu_init() won't remove the callback added by cpuhp_setup_state_multi() > when platform_driver_register() failed. Remove the callback by > cpuhp_remove_multi_state() in fail path. > > Similar to the handling of arm_ccn_init() in commit 26242b330093 ("bus: > arm-ccn: Prevent hotplug callback leak") > > Fixes: 7520fa99246d ("perf: ARM DynamIQ Shared Unit PMU support") > Signed-off-by: Yuan Can Acked-by: Suzuki K Poulose > --- > drivers/perf/arm_dsu_pmu.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/drivers/perf/arm_dsu_pmu.c b/drivers/perf/arm_dsu_pmu.c > index 4a15c86f45ef..fe2abb412c00 100644 > --- a/drivers/perf/arm_dsu_pmu.c > +++ b/drivers/perf/arm_dsu_pmu.c > @@ -858,7 +858,11 @@ static int __init dsu_pmu_init(void) > if (ret < 0) > return ret; > dsu_pmu_cpuhp_state = ret; > - return platform_driver_register(&dsu_pmu_driver); > + ret = platform_driver_register(&dsu_pmu_driver); > + if (ret) > + cpuhp_remove_multi_state(dsu_pmu_cpuhp_state); > + > + return ret; > } > > static void __exit dsu_pmu_exit(void) _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel