summaryrefslogtreecommitdiffstats
path: root/sys/netgraph
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2011-04-18 14:05:26 +0000
committerglebius <glebius@FreeBSD.org>2011-04-18 14:05:26 +0000
commit7af8d8ce83a71f03464a48cf43ad5d284800058f (patch)
tree7875e4af93b41c005fb91867ad87b8e64d55c393 /sys/netgraph
parent606a1588c78ee3a2423cba425b2967de28b337f0 (diff)
downloadFreeBSD-src-7af8d8ce83a71f03464a48cf43ad5d284800058f.zip
FreeBSD-src-7af8d8ce83a71f03464a48cf43ad5d284800058f.tar.gz
Further cleanup of node creation path from M_NOWAIT usage.
Diffstat (limited to 'sys/netgraph')
-rw-r--r--sys/netgraph/ng_sppp.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/sys/netgraph/ng_sppp.c b/sys/netgraph/ng_sppp.c
index 216ecbe..b963ba9 100644
--- a/sys/netgraph/ng_sppp.c
+++ b/sys/netgraph/ng_sppp.c
@@ -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);
OpenPOWER on IntegriCloud