Skip to content

Commit

Permalink
l2tp: remove useless device duplication test in l2tp_eth_create()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Guillaume Nault authored and David S. Miller committed Apr 27, 2017
1 parent 0575c86 commit 1514dc8
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions net/l2tp/l2tp_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 1514dc8

Please sign in to comment.