summaryrefslogtreecommitdiff
path: root/sys/arch/mac68k
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2006-08-17 10:34:15 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2006-08-17 10:34:15 +0000
commit0bfd0c9eeee1887c39a87a77e1a487056fb215f8 (patch)
tree34470413c18db602c641504f1d7108493b6bce27 /sys/arch/mac68k
parentbcd9b3f43d803a9c3588c2d8944185e7c8f0a5ca (diff)
Check d_secpercyl in all readdisklable() functions, and have all of
them return 'invalid geometry' when d_secpercyl == 0. While there move the check to a consistant location (after the check of d_secperunit) and use a consistant idiom (i.e. some readdisklabel()'s have no 'done' label). prodded by thib@ after a bad macppc experience. ok deraadt@
Diffstat (limited to 'sys/arch/mac68k')
-rw-r--r--sys/arch/mac68k/mac68k/disksubr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/arch/mac68k/mac68k/disksubr.c b/sys/arch/mac68k/mac68k/disksubr.c
index 0299749af9d..3d9408dc6d9 100644
--- a/sys/arch/mac68k/mac68k/disksubr.c
+++ b/sys/arch/mac68k/mac68k/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.29 2006/03/15 20:20:40 miod Exp $ */
+/* $OpenBSD: disksubr.c,v 1.30 2006/08/17 10:34:14 krw Exp $ */
/* $NetBSD: disksubr.c,v 1.22 1997/11/26 04:18:20 briggs Exp $ */
/*
@@ -375,7 +375,7 @@ readdisklabel(dev, strat, lp, osdep, spoofonly)
if (lp->d_secperunit == 0)
lp->d_secperunit = 0x1fffffff;
if (lp->d_secpercyl == 0)
- lp->d_secpercyl = 1;
+ return ("invalid geometry");
lp->d_npartitions = RAW_PART + 1;
for (i = 0; i < MAXPARTITIONS; i++) {
lp->d_partitions[i].p_size = 0;