Author: emaste
Date: Fri Oct 19 19:28:35 2012
New Revision: 241750
URL: http://svn.freebsd.org/changeset/base/241750

Log:
  Use M_NOWAIT when calling malloc with a lock held.
  
  The check for a NULL return was already in place so I assume this was just
  an oversight.

Modified:
  head/sys/dev/netmap/netmap_mem2.c

Modified: head/sys/dev/netmap/netmap_mem2.c
==============================================================================
--- head/sys/dev/netmap/netmap_mem2.c   Fri Oct 19 19:27:33 2012        
(r241749)
+++ head/sys/dev/netmap/netmap_mem2.c   Fri Oct 19 19:28:35 2012        
(r241750)
@@ -595,7 +595,7 @@ netmap_finalize_obj_allocator(struct net
 #ifdef linux
        p->lut = vmalloc(n);
 #else
-       p->lut = malloc(n, M_NETMAP, M_WAITOK | M_ZERO);
+       p->lut = malloc(n, M_NETMAP, M_NOWAIT | M_ZERO);
 #endif
        if (p->lut == NULL) {
                D("Unable to create lookup table (%d bytes) for '%s'", n, 
p->name);
@@ -604,7 +604,7 @@ netmap_finalize_obj_allocator(struct net
 
        /* Allocate the bitmap */
        n = (p->objtotal + 31) / 32;
-       p->bitmap = malloc(sizeof(uint32_t) * n, M_NETMAP, M_WAITOK | M_ZERO);
+       p->bitmap = malloc(sizeof(uint32_t) * n, M_NETMAP, M_NOWAIT | M_ZERO);
        if (p->bitmap == NULL) {
                D("Unable to create bitmap (%d entries) for allocator '%s'", n,
                    p->name);
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to