|
@@ -1006,17 +1006,18 @@ static int ppp_unit_register(struct ppp *ppp, int unit, bool ifname_is_set)
|
|
if (!ifname_is_set)
|
|
if (!ifname_is_set)
|
|
snprintf(ppp->dev->name, IFNAMSIZ, "ppp%i", ppp->file.index);
|
|
snprintf(ppp->dev->name, IFNAMSIZ, "ppp%i", ppp->file.index);
|
|
|
|
|
|
|
|
+ mutex_unlock(&pn->all_ppp_mutex);
|
|
|
|
+
|
|
ret = register_netdevice(ppp->dev);
|
|
ret = register_netdevice(ppp->dev);
|
|
if (ret < 0)
|
|
if (ret < 0)
|
|
goto err_unit;
|
|
goto err_unit;
|
|
|
|
|
|
atomic_inc(&ppp_unit_count);
|
|
atomic_inc(&ppp_unit_count);
|
|
|
|
|
|
- mutex_unlock(&pn->all_ppp_mutex);
|
|
|
|
-
|
|
|
|
return 0;
|
|
return 0;
|
|
|
|
|
|
err_unit:
|
|
err_unit:
|
|
|
|
+ mutex_lock(&pn->all_ppp_mutex);
|
|
unit_put(&pn->units_idr, ppp->file.index);
|
|
unit_put(&pn->units_idr, ppp->file.index);
|
|
err:
|
|
err:
|
|
mutex_unlock(&pn->all_ppp_mutex);
|
|
mutex_unlock(&pn->all_ppp_mutex);
|