Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Oct 2012 18:21:14 +0000 (UTC)
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r241643 - head/sys/dev/netmap
Message-ID:  <201210171821.q9HILEL4032423@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: emaste
Date: Wed Oct 17 18:21:14 2012
New Revision: 241643
URL: http://svn.freebsd.org/changeset/base/241643

Log:
  Avoid panic when a netmap instance cannot obtain memory.
  
  A uint32_t is always >= 0.
  
  Sponsored by: ADARA Networks

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

Modified: head/sys/dev/netmap/netmap_mem2.c
==============================================================================
--- head/sys/dev/netmap/netmap_mem2.c	Wed Oct 17 16:37:16 2012	(r241642)
+++ head/sys/dev/netmap/netmap_mem2.c	Wed Oct 17 18:21:14 2012	(r241643)
@@ -325,7 +325,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?201210171821.q9HILEL4032423>