Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5edfbd3c authored by Tonghao Zhang's avatar Tonghao Zhang Committed by David S. Miller
Browse files

tun/tap: Add the missed return value check of register_netdevice_notifier



There is some codes of tun/tap module which did not check the return
value of register_netdevice_notifier. Add the check now.

Signed-off-by: default avatarTonghao Zhang <xiangxia.m.yue@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6c7fce6f
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -2598,8 +2598,16 @@ static int __init tun_init(void)
		goto err_misc;
	}

	register_netdevice_notifier(&tun_notifier_block);
	ret = register_netdevice_notifier(&tun_notifier_block);
	if (ret) {
		pr_err("Can't register netdevice notifier\n");
		goto err_notifier;
	}

	return  0;

err_notifier:
	misc_deregister(&tun_miscdev);
err_misc:
	rtnl_link_unregister(&tun_link_ops);
err_linkops: