perf: Fix some hotplug callback leaks
cover perf: Fix some hotplug callback leaks
This series fix two error handling missing related problems that can lead to hotplug callback leaks.
Yuan Can (2):
perf: arm_dsu: Fix hotplug callback leak in dsu_pmu_init()
drivers: perf: marvell_cn10k: Fix hotplug callback leak in
tad_pmu_init()
drivers/perf/arm_dsu_pmu.c | 6 +++++- drivers/perf/marvell_cn10k_tad_pmu.c | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-)
Signature · 7 lines
2.17.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH 1/2 perf: arm_dsu: Fix hotplug callback leak in dsu_pmu_init()
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")
--- drivers/perf/arm_dsu_pmu.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/perf/arm_dsu_pmu.c +5 -1
@@ -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)
Signature · 7 lines
2.17.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Re: [PATCH 1/2] perf: arm_dsu: Fix hotplug callback leak in dsu_pmu_init()
Quoted 9 lines · Yuan Can
dsu_pmu_init()won't remove the callback added bycpuhp_setup_state_multi()whenplatform_driver_register()failed. Remove the callback bycpuhp_remove_multi_state()in fail path.Similar to the handling of
arm_ccn_init()in commit26242b330093("bus:
arm-ccn: Prevent hotplug callback leak")Fixes 7520fa99246d ("perf: ARM DynamIQ Shared Unit PMU support")Signed-off-by Yuan Can <[email protected]>
Quoted 11 lines
--- drivers/perf/arm_dsu_pmu.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)drivers/perf/arm_dsu_pmu.c +0
-0@@ -858,7 +858,11 @@ static int __init dsu_pmu_init(void)if (ret <0 )return ret;
drivers/perf/arm_dsu_pmu.c static int __init dsu_pmu_init(void) · line 868
Quoted 10 lines
drivers/perf/arm_dsu_pmu.c +5
-1dsu_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
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH 2/2 drivers: perf: marvell_cn10k: Fix hotplug callback leak in tad_pmu_init()
In reply to Yuan Cantad_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")
--- drivers/perf/marvell_cn10k_tad_pmu.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/perf/marvell_cn10k_tad_pmu.c +5 -1
@@ -408,7 +408,11 @@ static int __init tad_pmu_init(void)if (ret <0 )return ret; tad_pmu_cpuhp_state = ret; -return platform_driver_register (&tad_pmu_driver); + ret =platform_driver_register (&tad_pmu_driver); +if (ret) +cpuhp_remove_multi_state (tad_pmu_cpuhp_state); + +return ret; } static void __exit tad_pmu_exit(void)
Signature · 7 lines
2.17.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Quoted 9 lines · Yuan Can
This series fix two error handling missing related problems that can lead to hotplug callback leaks.
Yuan Can (2):
perf:arm_dsu: Fix hotplug callback leak indsu_pmu_init()
drivers: perf:marvell_cn10k: Fix hotplug callback leak intad_pmu_init()[...]
Applied to will (for-next/perf), thanks!
[1/2] perf: arm_dsu: Fix hotplug callback leak in dsu_pmu_init()
https://git.kernel.org/will/c/facafab7611f [2/2] drivers: perf: marvell_cn10k: Fix hotplug callback leak in tad_pmu_init() https://git.kernel.org/will/c/973ae93d80d9
Cheers,
Signature · 10 lines
Will https://fixes.arm64.dev https://next.arm64.dev https://will.arm64.dev _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel