net: Use rtnl_lock_killable() in register_netdev()
authorKirill Tkhai <ktkhai@virtuozzo.com>
Wed, 14 Mar 2018 19:17:28 +0000 (22:17 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 16 Mar 2018 16:31:19 +0000 (12:31 -0400)
This patch adds rtnl_lock_killable() to one of hot path
using rtnl_lock().

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/dev.c

index 12a9aad..d8887cc 100644 (file)
@@ -8018,7 +8018,8 @@ int register_netdev(struct net_device *dev)
 {
        int err;
 
-       rtnl_lock();
+       if (rtnl_lock_killable())
+               return -EINTR;
        err = register_netdevice(dev);
        rtnl_unlock();
        return err;