svn commit: r241643 - head/sys/dev/netmap
Ed Maste
emaste at FreeBSD.org
Wed Oct 17 18:21:15 UTC 2012
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);
}
}
More information about the svn-src-head
mailing list