diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1999-07-17 23:12:09 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1999-07-17 23:12:09 +0000 |
commit | 5c17fbcfd5e5aa3f34351dcabe619f16c8d4ed50 (patch) | |
tree | c72a26b699f15608f642309c67b73e85c4230869 /sys/arch/hppa | |
parent | 87df9bd27d41af05f3fc3af7a44c6e68c8d5139c (diff) |
do not brelse() badly
Diffstat (limited to 'sys/arch/hppa')
-rw-r--r-- | sys/arch/hppa/hppa/disksubr.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/arch/hppa/hppa/disksubr.c b/sys/arch/hppa/hppa/disksubr.c index d5149e9b148..9b2891a656f 100644 --- a/sys/arch/hppa/hppa/disksubr.c +++ b/sys/arch/hppa/hppa/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.3 1999/06/12 17:52:29 mickey Exp $ */ +/* $OpenBSD: disksubr.c,v 1.4 1999/07/17 23:12:07 deraadt Exp $ */ /* * Copyright (c) 1999 Michael Shalayeff @@ -243,7 +243,7 @@ readdisklabel(dev, strat, lp, osdep, spoofonly) struct cpu_disklabel *osdep; int spoofonly; { - struct buf *bp; + struct buf *bp = NULL; char *msg = "no disk label"; enum disklabel_tag *tp; int i; @@ -325,8 +325,10 @@ readdisklabel(dev, strat, lp, osdep, spoofonly) *lp = fallbacklabel; done: - bp->b_flags |= B_INVAL; - brelse(bp); + if (bp) { + bp->b_flags |= B_INVAL; + brelse(bp); + } return (msg); } |