Commit 3f8b9637 authored by Hong zhi guo's avatar Hong zhi guo Committed by David S. Miller

veth: remove redundant call of dev_alloc_name

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: default avatarHong Zhiguo <honkiko@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7a6e288d
...@@ -379,12 +379,6 @@ static int veth_newlink(struct net *src_net, struct net_device *dev, ...@@ -379,12 +379,6 @@ static int veth_newlink(struct net *src_net, struct net_device *dev,
else else
snprintf(dev->name, IFNAMSIZ, DRV_NAME "%%d"); 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); err = register_netdevice(dev);
if (err < 0) if (err < 0)
goto err_register_dev; goto err_register_dev;
...@@ -404,7 +398,6 @@ static int veth_newlink(struct net *src_net, struct net_device *dev, ...@@ -404,7 +398,6 @@ static int veth_newlink(struct net *src_net, struct net_device *dev,
err_register_dev: err_register_dev:
/* nothing to do */ /* nothing to do */
err_alloc_name:
err_configure_peer: err_configure_peer:
unregister_netdevice(peer); unregister_netdevice(peer);
return err; return err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment