netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] l2tp: remove useless device duplication test in l2tp_eth_create()
@ 2017-04-26  9:54 Guillaume Nault
  2017-04-27 20:32 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Guillaume Nault @ 2017-04-26  9:54 UTC (permalink / raw)
  To: netdev; +Cc: James Chapman

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>
---
 net/l2tp/l2tp_eth.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/net/l2tp/l2tp_eth.c b/net/l2tp/l2tp_eth.c
index 59aba8aeac03..8b21af7321b9 100644
--- a/net/l2tp/l2tp_eth.c
+++ b/net/l2tp/l2tp_eth.c
@@ -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 {
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] l2tp: remove useless device duplication test in l2tp_eth_create()
  2017-04-26  9:54 [PATCH net-next] l2tp: remove useless device duplication test in l2tp_eth_create() Guillaume Nault
@ 2017-04-27 20:32 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2017-04-27 20:32 UTC (permalink / raw)
  To: g.nault; +Cc: netdev, jchapman

From: Guillaume Nault <g.nault@alphalink.fr>
Date: Wed, 26 Apr 2017 11:54:47 +0200

> 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>

Yep that's right, applied, thanks!

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-04-27 20:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-26  9:54 [PATCH net-next] l2tp: remove useless device duplication test in l2tp_eth_create() Guillaume Nault
2017-04-27 20:32 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).