Commit d03eb978 authored by Antoine Tenart's avatar Antoine Tenart Committed by David S. Miller

ppp: use the correct function to check if a netdev name is in use

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: default avatarAntoine Tenart <atenart@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent caa9b35f
...@@ -1161,7 +1161,7 @@ static int ppp_unit_register(struct ppp *ppp, int unit, bool ifname_is_set) ...@@ -1161,7 +1161,7 @@ static int ppp_unit_register(struct ppp *ppp, int unit, bool ifname_is_set)
if (!ifname_is_set) { if (!ifname_is_set) {
while (1) { while (1) {
snprintf(ppp->dev->name, IFNAMSIZ, "ppp%i", ret); 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; break;
unit_put(&pn->units_idr, ret); unit_put(&pn->units_idr, ret);
ret = unit_get(&pn->units_idr, ppp, ret + 1); ret = unit_get(&pn->units_idr, ppp, ret + 1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment