summaryrefslogtreecommitdiff
path: root/drivers/bus
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2016-12-22 11:14:06 +0100
committerThomas Gleixner <tglx@linutronix.de>2016-12-25 10:47:40 +0100
commit26242b330093fd14c2e94fb6cbdf0f482ab26576 (patch)
treef21e73b34c9f07a1b078eb6c55f27f1f2630fde9 /drivers/bus
parent834fcd298003c10ce450e66960c78893cb1cc4b5 (diff)
downloadlwn-26242b330093fd14c2e94fb6cbdf0f482ab26576.tar.gz
lwn-26242b330093fd14c2e94fb6cbdf0f482ab26576.zip
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: fdc15a36d84e ("bus/arm-ccn: Convert to hotplug statemachine") Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Pawel Moll <pawel.moll@arm.com> Cc: Suzuki K Poulose <suzuki.poulose@arm.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'drivers/bus')
-rw-r--r--drivers/bus/arm-ccn.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/bus/arm-ccn.c b/drivers/bus/arm-ccn.c
index d1074d9b38ba..aee83462b796 100644
--- a/drivers/bus/arm-ccn.c
+++ b/drivers/bus/arm-ccn.c
@@ -1570,7 +1570,10 @@ static int __init arm_ccn_init(void)
for (i = 0; i < ARRAY_SIZE(arm_ccn_pmu_events); i++)
arm_ccn_pmu_events_attrs[i] = &arm_ccn_pmu_events[i].attr.attr;
- return platform_driver_register(&arm_ccn_driver);
+ ret = platform_driver_register(&arm_ccn_driver);
+ if (ret)
+ cpuhp_remove_multi_state(CPUHP_AP_PERF_ARM_CCN_ONLINE);
+ return ret;
}
static void __exit arm_ccn_exit(void)