diff --git a/net/sched/sch_cbs.c b/net/sched/sch_cbs.c index 81f84cb5dd23..b3c8d04929df 100644 --- a/net/sched/sch_cbs.c +++ b/net/sched/sch_cbs.c @@ -552,12 +552,17 @@ static struct notifier_block cbs_device_notifier = { static int __init cbs_module_init(void) { - int err = register_netdevice_notifier(&cbs_device_notifier); + int err; + err = register_netdevice_notifier(&cbs_device_notifier); if (err) return err; - return register_qdisc(&cbs_qdisc_ops); + err = register_qdisc(&cbs_qdisc_ops); + if (err) + unregister_netdevice_notifier(&cbs_device_notifier); + + return err; } static void __exit cbs_module_exit(void)