summaryrefslogtreecommitdiff
path: root/sys/arch/amd64
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2007-06-07 00:28:18 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2007-06-07 00:28:18 +0000
commit2b983a94dd05ba0dcd4e7d0f929d8c333e8c4ff8 (patch)
tree487d5866d3971c6c771894919fbed7e18df24ad8 /sys/arch/amd64
parent7e0751214480a4f7fe318bedcb4bf8e309a3148d (diff)
More bounds_check_with_label homogenization. Fix a couple of typos while
there. 'so go to it!' deraadt@
Diffstat (limited to 'sys/arch/amd64')
-rw-r--r--sys/arch/amd64/amd64/disksubr.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/sys/arch/amd64/amd64/disksubr.c b/sys/arch/amd64/amd64/disksubr.c
index 63b91cd1244..9a2eb06fc35 100644
--- a/sys/arch/amd64/amd64/disksubr.c
+++ b/sys/arch/amd64/amd64/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.39 2007/06/06 17:15:11 deraadt Exp $ */
+/* $OpenBSD: disksubr.c,v 1.40 2007/06/07 00:28:16 krw Exp $ */
/* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */
/*
@@ -487,7 +487,7 @@ bounds_check_with_label(struct buf *bp, struct disklabel *lp,
if (sz == 0) {
/* If exactly at end of disk, return EOF. */
bp->b_resid = bp->b_bcount;
- goto done;
+ return (-1);
}
if (sz < 0) {
/* If past end of disk, return EINVAL. */
@@ -500,9 +500,7 @@ bounds_check_with_label(struct buf *bp, struct disklabel *lp,
/* Overwriting disk label? */
if (bp->b_blkno + blockpersec(DL_GETPOFFSET(p), lp) <= labelsector &&
-#if LABELSECTOR != 0
bp->b_blkno + blockpersec(DL_GETPOFFSET(p), lp) + sz > labelsector &&
-#endif
(bp->b_flags & B_READ) == 0 && !wlabel) {
bp->b_error = EROFS;
goto bad;
@@ -515,6 +513,5 @@ bounds_check_with_label(struct buf *bp, struct disklabel *lp,
bad:
bp->b_flags |= B_ERROR;
-done:
return (-1);
}