Make sure the clone lists are sorted in the right order.

Explosion triggered by:	pjd
MFC:	3 days
This commit is contained in:
Poul-Henning Kamp 2005-10-01 19:21:03 +00:00
parent 1f8f09b081
commit 7bbb3a2690
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=150793

View file

@ -824,8 +824,10 @@ clone_create(struct clonedevs **cdp, struct cdevsw *csw, int *up, struct cdev **
low++;
de = dev;
continue;
}
if (u > (unit | extra)) {
} else if (u < (unit | extra)) {
de = dev;
continue;
} else if (u > (unit | extra)) {
dl = dev;
break;
}
@ -835,7 +837,7 @@ clone_create(struct clonedevs **cdp, struct cdevsw *csw, int *up, struct cdev **
dev = newdev(csw, unit2minor(unit | extra), ndev);
if (dev->si_flags & SI_CLONELIST) {
printf("dev %p (%s) is on clonelist\n", dev, dev->si_name);
printf("unit=%d\n", unit);
printf("unit=%d, low=%d, extra=0x%x\n", unit, low, extra);
LIST_FOREACH(dev, &cd->head, si_clone) {
printf("\t%p %s\n", dev, dev->si_name);
}