mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 11:50:43 +09:00
net/sched: cbs: Fix error path of cbs_module_init
[ Upstream commit45d5cb137c] If register_qdisc fails, we should unregister netdevice notifier. Reported-by: Hulk Robot <hulkci@huawei.com> Fixes:e0a7683d30("net/sched: cbs: fix port_rate miscalculation") Signed-off-by: YueHaibing <yuehaibing@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
9b1b59b540
commit
67da9350b3
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user