[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210928125500.167943-6-atenart@kernel.org>
Date: Tue, 28 Sep 2021 14:54:56 +0200
From: Antoine Tenart <atenart@...nel.org>
To: davem@...emloft.net, kuba@...nel.org
Cc: Antoine Tenart <atenart@...nel.org>, pabeni@...hat.com,
gregkh@...uxfoundation.org, ebiederm@...ssion.com,
stephen@...workplumber.org, herbert@...dor.apana.org.au,
juri.lelli@...hat.com, netdev@...r.kernel.org
Subject: [RFC PATCH net-next 5/9] ppp: use the correct function to check for netdev name collision
netdev_name_node_lookup and __dev_get_by_name have two distinct aims,
one helps in name collision detection, while the other is used to
retrieve a reference to a net device from its name. Here in
ppp_unit_register we want to check for a name collision, hence use the
correct function.
(The behaviour of the two functions was similar but will change in the
next commits).
Signed-off-by: Antoine Tenart <atenart@...nel.org>
---
drivers/net/ppp/ppp_generic.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c
index fb52cd175b45..c3e2f4da9949 100644
--- a/drivers/net/ppp/ppp_generic.c
+++ b/drivers/net/ppp/ppp_generic.c
@@ -1161,7 +1161,7 @@ static int ppp_unit_register(struct ppp *ppp, int unit, bool ifname_is_set)
if (!ifname_is_set) {
while (1) {
snprintf(ppp->dev->name, IFNAMSIZ, "ppp%i", ret);
- if (!__dev_get_by_name(ppp->ppp_net, ppp->dev->name))
+ if (!netdev_name_node_lookup(ppp->ppp_net, ppp->dev->name))
break;
unit_put(&pn->units_idr, ret);
ret = unit_get(&pn->units_idr, ppp, ret + 1);
--
2.31.1
Powered by blists - more mailing lists