svn commit: r220781 - head/sys/netgraph
Gleb Smirnoff
glebius at FreeBSD.org
Mon Apr 18 14:05:27 UTC 2011
Author: glebius
Date: Mon Apr 18 14:05:26 2011
New Revision: 220781
URL: http://svn.freebsd.org/changeset/base/220781
Log:
Further cleanup of node creation path from M_NOWAIT usage.
Modified:
head/sys/netgraph/ng_sppp.c
Modified: head/sys/netgraph/ng_sppp.c
==============================================================================
--- head/sys/netgraph/ng_sppp.c Mon Apr 18 14:03:37 2011 (r220780)
+++ head/sys/netgraph/ng_sppp.c Mon Apr 18 14:05:26 2011 (r220781)
@@ -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);
More information about the svn-src-all
mailing list