Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Apr 2011 18:18:10 +0000 (UTC)
From:      "Andrey V. Elsukov" <ae@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r221072 - stable/8/sys/netinet/ipfw
Message-ID:  <201104261818.p3QIIAYs033258@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ae
Date: Tue Apr 26 18:18:10 2011
New Revision: 221072
URL: http://svn.freebsd.org/changeset/base/221072

Log:
  MFC r220812:
    Use M_WAITOK instead M_WAIT for malloc. Remove unneded checks.

Modified:
  stable/8/sys/netinet/ipfw/ip_dummynet.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/netinet/ipfw/ip_dummynet.c
==============================================================================
--- stable/8/sys/netinet/ipfw/ip_dummynet.c	Tue Apr 26 17:01:49 2011	(r221071)
+++ stable/8/sys/netinet/ipfw/ip_dummynet.c	Tue Apr 26 18:18:10 2011	(r221072)
@@ -1833,9 +1833,7 @@ dummynet_get(struct sockopt *sopt, void 
 #endif
 		if (l > sizeof(r)) {
 			/* request larger than default, allocate buffer */
-			cmd = malloc(l,  M_DUMMYNET, M_WAIT);
-			if (cmd == NULL)
-				return ENOMEM; //XXX
+			cmd = malloc(l,  M_DUMMYNET, M_WAITOK);
 			error = sooptcopyin(sopt, cmd, l, l);
 			sopt->sopt_valsize = sopt_valsize;
 			if (error)
@@ -1891,10 +1889,6 @@ dummynet_get(struct sockopt *sopt, void 
 
 		have = need;
 		start = malloc(have, M_DUMMYNET, M_WAITOK | M_ZERO);
-		if (start == NULL) {
-			error = ENOMEM;
-			goto done;
-		}
 	}
 
 	if (start == NULL) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201104261818.p3QIIAYs033258>