ppp: use the correct function to check if a netdev name is in use
authorAntoine Tenart <atenart@kernel.org>
Thu, 7 Oct 2021 16:16:52 +0000 (18:16 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 8 Oct 2021 16:02:35 +0000 (17:02 +0100)
A new helper to detect if a net device name is in use was added. Use it
here as the return reference from __dev_get_by_name was discarded.

Signed-off-by: Antoine Tenart <atenart@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ppp/ppp_generic.c

index fb52cd1..1180a0e 100644 (file)
@@ -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_in_use(ppp->ppp_net, ppp->dev->name))
                                        break;
                                unit_put(&pn->units_idr, ret);
                                ret = unit_get(&pn->units_idr, ppp, ret + 1);