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/amd64 | |
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/amd64')
-rw-r--r-- | sys/arch/amd64/amd64/disksubr.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/arch/amd64/amd64/disksubr.c b/sys/arch/amd64/amd64/disksubr.c index 56cb3e71eba..d0395f77af6 100644 --- a/sys/arch/amd64/amd64/disksubr.c +++ b/sys/arch/amd64/amd64/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.31 2007/04/26 22:42:11 krw Exp $ */ +/* $OpenBSD: disksubr.c,v 1.32 2007/05/29 05:08:19 krw Exp $ */ /* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */ /* @@ -87,8 +87,10 @@ readdisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp, 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; |