From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 19:30:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 02B1464F; Mon, 19 Nov 2012 19:30:31 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DA8098FC14; Mon, 19 Nov 2012 19:30:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJJUUDw028488; Mon, 19 Nov 2012 19:30:30 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJJUUOT028487; Mon, 19 Nov 2012 19:30:30 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201211191930.qAJJUUOT028487@svn.freebsd.org> From: Ed Maste Date: Mon, 19 Nov 2012 19:30:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243304 - stable/9/sys/dev/netmap X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2012 19:30:31 -0000 Author: emaste Date: Mon Nov 19 19:30:30 2012 New Revision: 243304 URL: http://svnweb.freebsd.org/changeset/base/243304 Log: MFC r241643: Avoid panic when a netmap instance cannot obtain memory. A uint32_t is always >= 0. Sponsored by: ADARA Networks Modified: stable/9/sys/dev/netmap/netmap_mem2.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/netmap/netmap_mem2.c ============================================================================== --- stable/9/sys/dev/netmap/netmap_mem2.c Mon Nov 19 19:26:59 2012 (r243303) +++ stable/9/sys/dev/netmap/netmap_mem2.c Mon Nov 19 19:30:30 2012 (r243304) @@ -324,7 +324,8 @@ netmap_new_bufs(struct netmap_if *nifp _ return; cleanup: - for (i--; i >= 0; i--) { + while (i > 0) { + i--; netmap_obj_free(nm_mem->nm_buf_pool, slot[i].buf_idx); } }