summaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorTonghao Zhang <xiangxia.m.yue@gmail.com>2017-07-20 02:41:34 -0700
committerDavid S. Miller <davem@davemloft.net>2017-07-24 13:44:31 -0700
commit5edfbd3c0697e643f179dba819a7c09375b42543 (patch)
treedc35ad585e0ad601bee1804b69529ce49090bab9 /drivers/net
parent6c7fce6fa86a110d6455662d823c4e09f8f7be4a (diff)
downloadlinux-5edfbd3c0697e643f179dba819a7c09375b42543.tar.bz2
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: Tonghao Zhang <xiangxia.m.yue@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/tun.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 3d4c24572ecd..32ad87345f57 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -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: