PERFORCE change 113101 for review

Hans Petter Selasky hselasky at FreeBSD.org
Thu Jan 18 10:08:02 UTC 2007


http://perforce.freebsd.org/chv.cgi?CH=113101

Change 113101 by hselasky at hselasky_mini_itx on 2007/01/18 10:07:13

	If the number of devices changed during list traversal, set
	"count" to the lowest value.

Affected files ...

.. //depot/projects/usb/src/sys/kern/subr_bus.c#4 edit

Differences ...

==== //depot/projects/usb/src/sys/kern/subr_bus.c#4 (text+ko) ====

@@ -1876,13 +1876,16 @@
 	TAILQ_FOREACH(child, &dev->children, link) {
 		if (n < count) {
 			list[n] = child;
-			n++;
 		}
+		n++;
 	}
 
 	if (n != count) {
 		printf("device_get_children: Number of devices changed "
 		       "from %d to %d!\n", count, n);
+		if (n < count) {
+			count = n;
+		}
 	}
 
 	*devlistp = list;


More information about the p4-projects mailing list