diff options
Diffstat (limited to 'sys/arch/landisk/landisk/disksubr.c')
-rw-r--r-- | sys/arch/landisk/landisk/disksubr.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/arch/landisk/landisk/disksubr.c b/sys/arch/landisk/landisk/disksubr.c index 09ba4d46fea..d8730a8118b 100644 --- a/sys/arch/landisk/landisk/disksubr.c +++ b/sys/arch/landisk/landisk/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.28 2007/06/09 23:06:46 krw Exp $ */ +/* $OpenBSD: disksubr.c,v 1.29 2007/06/12 20:57:42 deraadt Exp $ */ /* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */ /* @@ -306,7 +306,7 @@ writedisklabel(dev_t dev, void (*strat)(struct buf *), { struct dos_partition dp[NDOSPART], *dp2; struct disklabel *dlp; - struct buf *bp; + struct buf *bp = NULL; int error, dospartoff, cyl, i; int ourpart = -1; @@ -376,7 +376,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); } |