m_clalloc() was improperly assuming that an mcl malloc would always succeed
authorMatthew Dillon <dillon@dragonflybsd.org>
Fri, 4 Feb 2005 01:14:27 +0000 (01:14 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Fri, 4 Feb 2005 01:14:27 +0000 (01:14 +0000)
when in fact it is allowed not to (because M_NULLOK is specified).

Reported-by: EM <EM1897@aol.com>
sys/kern/uipc_mbuf.c

index 4156c3d..78064aa 100644 (file)
@@ -82,7 +82,7 @@
  *
  * @(#)uipc_mbuf.c     8.2 (Berkeley) 1/4/94
  * $FreeBSD: src/sys/kern/uipc_mbuf.c,v 1.51.2.24 2003/04/15 06:59:29 silby Exp $
- * $DragonFly: src/sys/kern/uipc_mbuf.c,v 1.29 2004/11/18 01:42:26 dillon Exp $
+ * $DragonFly: src/sys/kern/uipc_mbuf.c,v 1.30 2005/02/04 01:14:27 dillon Exp $
  */
 
 #include "opt_param.h"
@@ -428,6 +428,8 @@ m_clalloc(int ncl, int how)
                        mbstat.m_wait++;
                        mcl = malloc(sizeof(*mcl), 
                                        M_MBUFCL, M_WAITOK|M_NULLOK|M_ZERO);
+                       if (mcl == NULL)
+                               break;
                }
 
                /*