Fix a bug in the checking of malloc()'s return value. It turns out to have
authorMatthew Dillon <dillon@dragonflybsd.org>
Wed, 17 Nov 2004 18:27:17 +0000 (18:27 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Wed, 17 Nov 2004 18:27:17 +0000 (18:27 +0000)
been masked by the fact that M_WAITOK does not return NULL anyway.

Submitted-by: Andrew Atrens <atrens@nortelnetworks.com>
sys/emulation/ndis/subr_ndis.c

index ad4ae4b..bdb22d2 100644 (file)
@@ -30,7 +30,7 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  *
  * $FreeBSD: src/sys/compat/ndis/subr_ndis.c,v 1.62 2004/07/11 00:19:30 wpaul Exp $
- * $DragonFly: src/sys/emulation/ndis/subr_ndis.c,v 1.6 2004/11/12 00:09:20 dillon Exp $
+ * $DragonFly: src/sys/emulation/ndis/subr_ndis.c,v 1.7 2004/11/17 18:27:17 dillon Exp $
  */
 
 /*
@@ -1561,7 +1561,7 @@ ndis_alloc_packetpool(status, pool, descnum, protrsvdlen)
            ((descnum + NDIS_POOL_EXTRA) + 1),
            M_DEVBUF, M_WAITOK|M_ZERO);
 
-       if (pool == NULL) {
+       if (*pool == NULL) {
                *status = NDIS_STATUS_RESOURCES;
                return;
        }
@@ -1784,7 +1784,7 @@ ndis_alloc_bufpool(status, pool, descnum)
            ((descnum + NDIS_POOL_EXTRA) + 1),
            M_DEVBUF, M_WAITOK|M_ZERO);
 
-       if (pool == NULL) {
+       if (*pool == NULL) {
                *status = NDIS_STATUS_RESOURCES;
                return;
        }