[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191008212034.172771-1-edumazet@google.com>
Date: Tue, 8 Oct 2019 14:20:34 -0700
From: Eric Dumazet <edumazet@...gle.com>
To: "David S . Miller" <davem@...emloft.net>
Cc: netdev <netdev@...r.kernel.org>,
Eric Dumazet <edumazet@...gle.com>,
Eric Dumazet <eric.dumazet@...il.com>,
Jakub Kicinski <jakub.kicinski@...ronome.com>
Subject: [PATCH net-next] Revert "tun: call dev_get_valid_name() before register_netdevice()"
This reverts commit 0ad646c81b2182f7fa67ec0c8c825e0ee165696d.
As noticed by Jakub, this is no longer needed after
commit 11fc7d5a0a2d ("tun: fix memory leak in error path")
This no longer exports dev_get_valid_name() for the exclusive
use of tun driver.
Suggested-by: Jakub Kicinski <jakub.kicinski@...ronome.com>
Signed-off-by: Eric Dumazet <edumazet@...gle.com>
---
drivers/net/tun.c | 3 ---
include/linux/netdevice.h | 3 ---
net/core/dev.c | 5 ++---
3 files changed, 2 insertions(+), 9 deletions(-)
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 1e541b08b136364302aa524e31efb62062c43faa..0413d182d7821ca5bac794df43717149d78a6117 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -2788,9 +2788,6 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
if (!dev)
return -ENOMEM;
- err = dev_get_valid_name(net, dev, name);
- if (err < 0)
- goto err_free_dev;
dev_net_set(dev, net);
dev->rtnl_link_ops = &tun_link_ops;
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index fe45b2c72315f422dfa1b1e74a033777dd83fa21..3207e0b9ec4e3065a4a364b676e3ff3101719fa5 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -4113,9 +4113,6 @@ struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name,
unsigned char name_assign_type,
void (*setup)(struct net_device *),
unsigned int txqs, unsigned int rxqs);
-int dev_get_valid_name(struct net *net, struct net_device *dev,
- const char *name);
-
#define alloc_netdev(sizeof_priv, name, name_assign_type, setup) \
alloc_netdev_mqs(sizeof_priv, name, name_assign_type, setup, 1, 1)
diff --git a/net/core/dev.c b/net/core/dev.c
index 7d05e042c6bade23c3f253cf73a4f51b9cf71fd7..8bc3dce71fc08e80cfaa151576ff7b8503796791 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1249,8 +1249,8 @@ int dev_alloc_name(struct net_device *dev, const char *name)
}
EXPORT_SYMBOL(dev_alloc_name);
-int dev_get_valid_name(struct net *net, struct net_device *dev,
- const char *name)
+static int dev_get_valid_name(struct net *net, struct net_device *dev,
+ const char *name)
{
BUG_ON(!net);
@@ -1266,7 +1266,6 @@ int dev_get_valid_name(struct net *net, struct net_device *dev,
return 0;
}
-EXPORT_SYMBOL(dev_get_valid_name);
/**
* dev_change_name - change name of a device
--
2.23.0.581.g78d2f28ef7-goog
Powered by blists - more mailing lists