Skip to content

Commit

Permalink
veth: remove redundant call of dev_alloc_name
Browse files Browse the repository at this point in the history
it's called in the following register_netdevice. No need to call it
here.
Tested with "ip link add type veth" and "ip link add xxx%d type veth".

Signed-off-by: Hong Zhiguo <honkiko@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Hong zhi guo authored and David S. Miller committed Jun 12, 2013
1 parent 7a6e288 commit 3f8b963
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions drivers/net/veth.c
Original file line number Diff line number Diff line change
Expand Up @@ -379,12 +379,6 @@ static int veth_newlink(struct net *src_net, struct net_device *dev,
else
snprintf(dev->name, IFNAMSIZ, DRV_NAME "%%d");

if (strchr(dev->name, '%')) {
err = dev_alloc_name(dev, dev->name);
if (err < 0)
goto err_alloc_name;
}

err = register_netdevice(dev);
if (err < 0)
goto err_register_dev;
Expand All @@ -404,7 +398,6 @@ static int veth_newlink(struct net *src_net, struct net_device *dev,

err_register_dev:
/* nothing to do */
err_alloc_name:
err_configure_peer:
unregister_netdevice(peer);
return err;
Expand Down

0 comments on commit 3f8b963

Please sign in to comment.