summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2003-04-06 22:01:44 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2003-04-06 22:01:44 +0000
commitedd036bcd309a616f07f293aa53f9d31838370f9 (patch)
tree957736da452baff6b161789a873fb2a1f71d32b2
parent7e52960e52fccb96f412b37441530e4563f10d1e (diff)
The return value for bounds_check_with_label() is not set in stone, and it
turns out that some arches will return (-1) in case of error, while others will return (0). Until we make our minds on this, make sure that callers of this function properly handle 0 or (-1) as failure. ok krw@
-rw-r--r--sys/arch/vax/mba/hp.c7
-rw-r--r--sys/dev/vnd.c4
2 files changed, 5 insertions, 6 deletions
diff --git a/sys/arch/vax/mba/hp.c b/sys/arch/vax/mba/hp.c
index e663a33dcbb..d156a49a41e 100644
--- a/sys/arch/vax/mba/hp.c
+++ b/sys/arch/vax/mba/hp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hp.c,v 1.13 2003/04/06 03:02:44 krw Exp $ */
+/* $OpenBSD: hp.c,v 1.14 2003/04/06 22:01:41 miod Exp $ */
/* $NetBSD: hp.c,v 1.22 2000/02/12 16:09:33 ragge Exp $ */
/*
* Copyright (c) 1996 Ludd, University of Lule}, Sweden.
@@ -182,15 +182,14 @@ hpstrategy(bp)
{
struct hp_softc *sc;
struct buf *gp;
- int unit, s, err;
+ int unit, s;
struct disklabel *lp;
unit = DISKUNIT(bp->b_dev);
sc = hp_cd.cd_devs[unit];
lp = sc->sc_disk.dk_label;
- err = bounds_check_with_label(bp, lp, sc->sc_wlabel);
- if (err < 0)
+ if (bounds_check_with_label(bp, lp, sc->sc_wlabel) <= 0)
goto done;
bp->b_rawblkno =
diff --git a/sys/dev/vnd.c b/sys/dev/vnd.c
index 06f5077ed71..a4142dd29e7 100644
--- a/sys/dev/vnd.c
+++ b/sys/dev/vnd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vnd.c,v 1.35 2003/02/25 09:13:35 tedu Exp $ */
+/* $OpenBSD: vnd.c,v 1.36 2003/04/06 22:01:43 miod Exp $ */
/* $NetBSD: vnd.c,v 1.26 1996/03/30 23:06:11 christos Exp $ */
/*
@@ -429,7 +429,7 @@ vndstrategy(bp)
}
if (DISKPART(bp->b_dev) != RAW_PART &&
bounds_check_with_label(bp, vnd->sc_dk.dk_label,
- vnd->sc_dk.dk_cpulabel, 1) == 0) {
+ vnd->sc_dk.dk_cpulabel, 1) <= 0) {
s = splbio();
biodone(bp);
splx(s);