aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/veth.c
diff options
context:
space:
mode:
authorHong zhi guo <honkiko@gmail.com>2013-06-09 08:15:20 -0400
committerDavid S. Miller <davem@davemloft.net>2013-06-12 04:21:20 -0400
commit3f8b96379a820318db37f7b6e81e6e459ad56efe (patch)
tree472e52b4ed549ae9cdeaee26ec5f9067af4fdefd /drivers/net/veth.c
parent7a6e288d2745611bef5b614acf19644283765732 (diff)
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: Hong Zhiguo <honkiko@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/veth.c')
-rw-r--r--drivers/net/veth.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/drivers/net/veth.c b/drivers/net/veth.c
index 177f911f5946..da866523cf20 100644
--- a/drivers/net/veth.c
+++ b/drivers/net/veth.c
@@ -379,12 +379,6 @@ static int veth_newlink(struct net *src_net, struct net_device *dev,
379 else 379 else
380 snprintf(dev->name, IFNAMSIZ, DRV_NAME "%%d"); 380 snprintf(dev->name, IFNAMSIZ, DRV_NAME "%%d");
381 381
382 if (strchr(dev->name, '%')) {
383 err = dev_alloc_name(dev, dev->name);
384 if (err < 0)
385 goto err_alloc_name;
386 }
387
388 err = register_netdevice(dev); 382 err = register_netdevice(dev);
389 if (err < 0) 383 if (err < 0)
390 goto err_register_dev; 384 goto err_register_dev;
@@ -404,7 +398,6 @@ static int veth_newlink(struct net *src_net, struct net_device *dev,
404 398
405err_register_dev: 399err_register_dev:
406 /* nothing to do */ 400 /* nothing to do */
407err_alloc_name:
408err_configure_peer: 401err_configure_peer:
409 unregister_netdevice(peer); 402 unregister_netdevice(peer);
410 return err; 403 return err;