Skip to content

Commit 26242b3

Browse files
committed
bus: arm-ccn: Prevent hotplug callback leak
In case the driver registration fails, the hotplug callback is leaked. Not fatal, because it's never invoked as there are no instances registered, but wrong nevertheless. Fixes: fdc15a3 ("bus/arm-ccn: Convert to hotplug statemachine") Signed-off-by: Thomas Gleixner <[email protected]> Cc: Sebastian Andrzej Siewior <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Pawel Moll <[email protected]> Cc: Suzuki K Poulose <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Will Deacon <[email protected]>
1 parent 834fcd2 commit 26242b3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/bus/arm-ccn.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1570,7 +1570,10 @@ static int __init arm_ccn_init(void)
15701570
for (i = 0; i < ARRAY_SIZE(arm_ccn_pmu_events); i++)
15711571
arm_ccn_pmu_events_attrs[i] = &arm_ccn_pmu_events[i].attr.attr;
15721572

1573-
return platform_driver_register(&arm_ccn_driver);
1573+
ret = platform_driver_register(&arm_ccn_driver);
1574+
if (ret)
1575+
cpuhp_remove_multi_state(CPUHP_AP_PERF_ARM_CCN_ONLINE);
1576+
return ret;
15741577
}
15751578

15761579
static void __exit arm_ccn_exit(void)

0 commit comments

Comments
 (0)