diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2007-05-29 05:08:21 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2007-05-29 05:08:21 +0000 |
commit | 718c8f1c45893b892977d08b340dcf99697074d3 (patch) | |
tree | 208a343033771c2864117f6ba44d29018fef79d8 /sys/arch/mips64 | |
parent | 2adfdb5db46336bf3180da10112743e21c8c8d45 (diff) |
Refactor readdisklabel() to ensure there is a single point of return, in
preparation for translating all disk labels visible to the kernel to
the soon to arrive V1 format.
ok otto@ deraadt@
Diffstat (limited to 'sys/arch/mips64')
-rw-r--r-- | sys/arch/mips64/mips64/disksubr.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/arch/mips64/mips64/disksubr.c b/sys/arch/mips64/mips64/disksubr.c index 1edc6b9d6d8..f48e84212a2 100644 --- a/sys/arch/mips64/mips64/disksubr.c +++ b/sys/arch/mips64/mips64/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.36 2007/02/18 14:18:28 krw Exp $ */ +/* $OpenBSD: disksubr.c,v 1.37 2007/05/29 05:08:20 krw Exp $ */ /* * Copyright (c) 1999 Michael Shalayeff @@ -146,8 +146,10 @@ readdisklabel(dev, strat, lp, osdep, spoofonly) lp->d_secsize = DEV_BSIZE; if (lp->d_secperunit == 0) lp->d_secperunit = 0x1fffffff; - if (lp->d_secpercyl == 0) - return ("invalid geometry"); + if (lp->d_secpercyl == 0) { + msg = "invalid geometry"; + goto done; + } lp->d_npartitions = RAW_PART + 1; for (i = 0; i < RAW_PART; i++) { lp->d_partitions[i].p_size = 0; @@ -194,6 +196,7 @@ readdisklabel(dev, strat, lp, osdep, spoofonly) if (msg) *lp = fallbacklabel; +done: if (bp) { bp->b_flags |= B_INVAL; brelse(bp); |