From: Thomas Gleixner Date: Thu, 22 Dec 2016 10:14:06 +0000 (+0100) Subject: bus: arm-ccn: Prevent hotplug callback leak X-Git-Tag: v5.15~12161^2~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=26242b330093fd14c2e94fb6cbdf0f482ab26576;p=platform%2Fkernel%2Flinux-starfive.git 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 Cc: Sebastian Andrzej Siewior Cc: Mark Rutland Cc: Pawel Moll Cc: Suzuki K Poulose Cc: Peter Zijlstra Cc: Will Deacon --- diff --git a/drivers/bus/arm-ccn.c b/drivers/bus/arm-ccn.c index d1074d9..aee8346 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)