diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/alpha/alpha/disksubr.c | 10 | ||||
-rw-r--r-- | sys/arch/hppa/hppa/disksubr.c | 10 | ||||
-rw-r--r-- | sys/arch/mac68k/mac68k/disksubr.c | 7 | ||||
-rw-r--r-- | sys/arch/mips/mips/disksubr.c | 10 |
4 files changed, 21 insertions, 16 deletions
diff --git a/sys/arch/alpha/alpha/disksubr.c b/sys/arch/alpha/alpha/disksubr.c index 6e1abc05ae2..8c3debfee37 100644 --- a/sys/arch/alpha/alpha/disksubr.c +++ b/sys/arch/alpha/alpha/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.28 1999/05/03 22:33:31 mickey Exp $ */ +/* $OpenBSD: disksubr.c,v 1.29 1999/07/17 23:12:07 deraadt Exp $ */ /* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */ /* @@ -235,7 +235,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; @@ -311,8 +311,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); } 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); } diff --git a/sys/arch/mac68k/mac68k/disksubr.c b/sys/arch/mac68k/mac68k/disksubr.c index aac05f3cc0f..a65bd56e895 100644 --- a/sys/arch/mac68k/mac68k/disksubr.c +++ b/sys/arch/mac68k/mac68k/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.11 1999/04/19 04:48:02 downsj Exp $ */ +/* $OpenBSD: disksubr.c,v 1.12 1999/07/17 23:12:08 deraadt Exp $ */ /* $NetBSD: disksubr.c,v 1.22 1997/11/26 04:18:20 briggs Exp $ */ /* @@ -491,9 +491,8 @@ readdisklabel(dev, strat, lp, osdep, spoofonly) if (lp->d_secperunit == 0) lp->d_secperunit = 0x1fffffff; - if (lp->d_secpercyl == 0) { - return msg = "Zero secpercyl"; - } + if (lp->d_secpercyl == 0) + return (msg = "Zero secpercyl"); /* don't read the on-disk label if we are in spoofed-only mode */ if (spoofonly) 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); } |