From owner-svn-src-all@FreeBSD.ORG Mon Apr 18 14:05:27 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0603E1065673; Mon, 18 Apr 2011 14:05:27 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E73568FC0C; Mon, 18 Apr 2011 14:05:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p3IE5QFa074113; Mon, 18 Apr 2011 14:05:26 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p3IE5QCe074111; Mon, 18 Apr 2011 14:05:26 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201104181405.p3IE5QCe074111@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 18 Apr 2011 14:05:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r220781 - head/sys/netgraph X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2011 14:05:27 -0000 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);