summaryrefslogtreecommitdiff
path: root/sys/arch/mips
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1999-07-17 23:12:09 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1999-07-17 23:12:09 +0000
commit5c17fbcfd5e5aa3f34351dcabe619f16c8d4ed50 (patch)
treec72a26b699f15608f642309c67b73e85c4230869 /sys/arch/mips
parent87df9bd27d41af05f3fc3af7a44c6e68c8d5139c (diff)
do not brelse() badly
Diffstat (limited to 'sys/arch/mips')
-rw-r--r--sys/arch/mips/mips/disksubr.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/arch/mips/mips/disksubr.c b/sys/arch/mips/mips/disksubr.c
index 28e9f81be00..270d61bf233 100644
--- a/sys/arch/mips/mips/disksubr.c
+++ b/sys/arch/mips/mips/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.8 1999/01/08 04:29:07 millert Exp $ */
+/* $OpenBSD: disksubr.c,v 1.9 1999/07/17 23:12:08 deraadt Exp $ */
/* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */
/*
@@ -86,7 +86,7 @@ readdisklabel(dev, strat, lp, osdep, spoofonly)
{
struct dos_partition *dp = osdep->dosparts, *dp2;
struct dkbad *bdp = &DKBAD(osdep);
- struct buf *bp;
+ struct buf *bp = NULL;
struct disklabel *dlp;
char *msg = NULL, *cp;
int dospartoff, cyl, i, ourpart = -1;
@@ -326,8 +326,10 @@ donot:
}
done:
- bp->b_flags |= B_INVAL;
- brelse(bp);
+ if (bp) {
+ bp->b_flags |= B_INVAL;
+ brelse(bp);
+ }
return (msg);
}