]> git.baikalelectronics.ru Git - kernel.git/commit
perf: arm_dsu: Fix hotplug callback leak in dsu_pmu_init()
authorYuan Can <yuancan@huawei.com>
Tue, 15 Nov 2022 07:02:06 +0000 (07:02 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jan 2023 10:40:50 +0000 (11:40 +0100)
commitdb31e5478c9243083d5bdb70d1b5312e069b6dc4
tree994c1c903158903cdb5a8b0c6cf34b38052188f1
parent73e4040df02e124aeaea2829fa275c53c08006e5
perf: arm_dsu: Fix hotplug callback leak in dsu_pmu_init()

[ Upstream commit facafab7611f7b872c6b9eeaff53461ef11f482e ]

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 af0a3a3c6a96 ("bus:
arm-ccn: Prevent hotplug callback leak")

Fixes: ab287d045d62 ("perf: ARM DynamIQ Shared Unit PMU support")
Signed-off-by: Yuan Can <yuancan@huawei.com>
Acked-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/20221115070207.32634-2-yuancan@huawei.com
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/perf/arm_dsu_pmu.c