summaryrefslogtreecommitdiff
path: root/sys/arch/mac68k
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2007-06-12 20:57:44 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2007-06-12 20:57:44 +0000
commitd92a22088820bed9b2ad499b3fb0bf27bc9f8223 (patch)
tree23eefe8eebbc59fe8751ac9fee2b2e2dcfc20830 /sys/arch/mac68k
parentbb9f20de9237688ceb64944e9fdca9bd454679c0 (diff)
all disksubr.c did their b_flags manipulation differently (and wrong).
correct and unify; ok thib miod
Diffstat (limited to 'sys/arch/mac68k')
-rw-r--r--sys/arch/mac68k/mac68k/disksubr.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/arch/mac68k/mac68k/disksubr.c b/sys/arch/mac68k/mac68k/disksubr.c
index 23b1bcf65db..0f779bc7bf4 100644
--- a/sys/arch/mac68k/mac68k/disksubr.c
+++ b/sys/arch/mac68k/mac68k/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.44 2007/06/09 23:06:46 krw Exp $ */
+/* $OpenBSD: disksubr.c,v 1.45 2007/06/12 20:57:42 deraadt Exp $ */
/* $NetBSD: disksubr.c,v 1.22 1997/11/26 04:18:20 briggs Exp $ */
/*
@@ -438,7 +438,7 @@ int
writedisklabel(dev_t dev, void (*strat)(struct buf *),
struct disklabel *lp, struct cpu_disklabel *osdep)
{
- struct buf *bp;
+ struct buf *bp = NULL;
struct disklabel *dlp;
int labelpart;
int error = 0;
@@ -480,7 +480,9 @@ writedisklabel(dev_t dev, void (*strat)(struct buf *),
error = biowait(bp);
done:
- bp->b_flags |= B_INVAL;
- brelse(bp);
+ if (bp) {
+ bp->b_flags |= B_INVAL;
+ brelse(bp);
+ }
return (error);
}