Further cleanup of node creation path from M_NOWAIT usage.

This commit is contained in:
Gleb Smirnoff 2011-04-18 14:05:26 +00:00
parent abc8309448
commit c1d21557c5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=220781

View File

@ -108,7 +108,7 @@ static unsigned char ng_units_in_use = 0;
* Find the first free unit number for a new interface.
* Increase the size of the unit bitmap as necessary.
*/
static __inline int
static __inline void
ng_sppp_get_unit (int *unit)
{
int index, bit;
@ -122,9 +122,7 @@ ng_sppp_get_unit (int *unit)
newlen = (2 * ng_sppp_units_len) + sizeof (*ng_sppp_units);
newarray = malloc (newlen * sizeof (*ng_sppp_units),
M_NETGRAPH_SPPP, M_NOWAIT);
if (newarray == NULL)
return (ENOMEM);
M_NETGRAPH_SPPP, M_WAITOK);
bcopy (ng_sppp_units, newarray,
ng_sppp_units_len * sizeof (*ng_sppp_units));
bzero (newarray + ng_sppp_units_len,
@ -142,7 +140,6 @@ ng_sppp_get_unit (int *unit)
ng_sppp_units[index] |= (1 << bit);
*unit = (index * NBBY) + bit;
ng_units_in_use++;
return (0);
}
/*
@ -262,12 +259,7 @@ ng_sppp_constructor (node_p node)
priv->ifp = ifp;
/* Get an interface unit number */
if ((error = ng_sppp_get_unit(&priv->unit)) != 0) {
free (pp, M_NETGRAPH_SPPP);
free (priv, M_NETGRAPH_SPPP);
return (error);
}
ng_sppp_get_unit(&priv->unit);
/* Link together node and private info */
NG_NODE_SET_PRIVATE (node, priv);