Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Nov 2012 19:30:30 +0000 (UTC)
From:      Ed Maste <emaste@FreeBSD.org>
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
Message-ID:  <201211191930.qAJJUUOT028487@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
 	}
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201211191930.qAJJUUOT028487>