]> git.baikalelectronics.ru Git - kernel.git/commit
perf/smmuv3: Fix hotplug callback leak in arm_smmu_pmu_init()
authorShang XiaoJing <shangxiaojing@huawei.com>
Tue, 15 Nov 2022 11:55:40 +0000 (19:55 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jan 2023 10:40:50 +0000 (11:40 +0100)
commitcb8b5e0e695514450d6fff317e7e88b739f36767
tree631f8d3ac04d32e3a3b1400c562fcca253f1cb46
parentdb31e5478c9243083d5bdb70d1b5312e069b6dc4
perf/smmuv3: Fix hotplug callback leak in arm_smmu_pmu_init()

[ Upstream commit 6f2d566b46436a50a80d6445e82879686b89588c ]

arm_smmu_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: 48636708280a ("perf/smmuv3: Add arm64 smmuv3 pmu driver")
Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
Reviewed-by: Punit Agrawal <punit.agrawal@bytedance.com>
Link: https://lore.kernel.org/r/20221115115540.6245-3-shangxiaojing@huawei.com
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/perf/arm_smmuv3_pmu.c