]> 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)
commit1169e04541a34886d665f5365c6bdc7bef6ea151
tree994c1c903158903cdb5a8b0c6cf34b38052188f1
parente86f81bca9702b0ceb2a3be51f15beff788d0d23
perf: arm_dsu: Fix hotplug callback leak in dsu_pmu_init()

[ Upstream commit 8ad871026b0412becf7a1bc051736d23561c2d76 ]

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

Fixes: 166459eeac54 ("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