l2tp: remove useless device duplication test in l2tp_eth_create()
authorGuillaume Nault <g.nault@alphalink.fr>
Wed, 26 Apr 2017 09:54:47 +0000 (11:54 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 27 Apr 2017 20:32:13 +0000 (16:32 -0400)
There's no need to verify that cfg->ifname is unique at this point.
register_netdev() will return -EEXIST if asked to create a device with
a name that's alrealy in use.

Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/l2tp/l2tp_eth.c

index 59aba8aeac03f309c79d16f90b85231cedbc1d84..8b21af7321b928b4dcc5d7af3a6667380e9a949a 100644 (file)
@@ -280,12 +280,6 @@ static int l2tp_eth_create(struct net *net, u32 tunnel_id, u32 session_id, u32 p
        }
 
        if (cfg->ifname) {
-               dev = dev_get_by_name(net, cfg->ifname);
-               if (dev) {
-                       dev_put(dev);
-                       rc = -EEXIST;
-                       goto out;
-               }
                strlcpy(name, cfg->ifname, IFNAMSIZ);
                name_assign_type = NET_NAME_USER;
        } else {