summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Evans <bde@FreeBSD.org>2000-06-14 16:01:57 +0000
committerBruce Evans <bde@FreeBSD.org>2000-06-14 16:01:57 +0000
commit64a5bc137e87976a06b49ad960865c6f59b05b37 (patch)
tree38c4b1f5324169c27db8f6b0a2ee751528e8553e
parent70d944aeaff9ebad93b0cf46d37107f1b824a237 (diff)
Notes
-rw-r--r--sys/kern/subr_bus.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c
index 54827246f48b..922297fd45ff 100644
--- a/sys/kern/subr_bus.c
+++ b/sys/kern/subr_bus.c
@@ -385,8 +385,7 @@ devclass_alloc_unit(devclass_t dc, int *unitp)
device_t *newlist;
int newsize;
- newsize = (dc->maxunit ? 2 * dc->maxunit
- : MINALLOCSIZE / sizeof(device_t));
+ newsize = roundup((unit + 1), MINALLOCSIZE / sizeof(device_t));
newlist = malloc(sizeof(device_t) * newsize, M_DEVBUF, M_NOWAIT);
if (!newlist)
return ENOMEM;