From owner-svn-src-head@FreeBSD.ORG Fri Oct 19 19:28:36 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 448E111E; Fri, 19 Oct 2012 19:28:36 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 256488FC0C; Fri, 19 Oct 2012 19:28:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9JJSa2F061411; Fri, 19 Oct 2012 19:28:36 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9JJSZtu061409; Fri, 19 Oct 2012 19:28:35 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201210191928.q9JJSZtu061409@svn.freebsd.org> From: Ed Maste Date: Fri, 19 Oct 2012 19:28:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241750 - head/sys/dev/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Oct 2012 19:28:36 -0000 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);