summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/kern/subr_disk.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/kern/subr_disk.c b/sys/kern/subr_disk.c
index 0b98fea394d3..baf2cdaecd70 100644
--- a/sys/kern/subr_disk.c
+++ b/sys/kern/subr_disk.c
@@ -55,6 +55,8 @@ disk_clone(void *arg, char *name, int namelen, dev_t *dev)
u *= 10;
u += name[i++] - '0';
}
+ if (u > DKMAXUNIT)
+ continue;
p = RAW_PART;
s = WHOLE_DISK_SLICE;
pdev = makedev(dp->d_devsw->d_maj, dkmakeminor(u, s, p));