summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2010-09-01 20:16:52 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2010-09-01 20:16:52 +0000
commita836a986073697733f84f0f2a3c8cc6d04600c8a (patch)
tree802074d333527a59fe05177a904813539fe85af1
parent3d5772549f7156c796a7d22609d4834702af4d12 (diff)
Do not panic in parsedisk() for ``second class'' block devices (which we can't
root off), return NULL instead.
-rw-r--r--sys/kern/subr_disk.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/subr_disk.c b/sys/kern/subr_disk.c
index 966b2929159..192b892a68b 100644
--- a/sys/kern/subr_disk.c
+++ b/sys/kern/subr_disk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_disk.c,v 1.106 2010/08/30 16:53:28 jsing Exp $ */
+/* $OpenBSD: subr_disk.c,v 1.107 2010/09/01 20:16:51 miod Exp $ */
/* $NetBSD: subr_disk.c,v 1.17 1996/03/16 23:17:08 christos Exp $ */
/*
@@ -1023,7 +1023,7 @@ parsedisk(char *str, int len, int defpart, dev_t *devp)
dv->dv_xname[len] == '\0') {
majdev = findblkmajor(dv);
if (majdev < 0)
- panic("parsedisk");
+ return NULL;
*devp = MAKEDISKDEV(majdev, dv->dv_unit, part);
break;
}