From 0dadd7f429fa7f95f2699992a45e9ed0d67f5fa4 Mon Sep 17 00:00:00 2001 From: soda Date: Tue, 21 Mar 2000 09:44:57 +0000 Subject: [PATCH] if there is MBR, but there isn't BSD MBR partition entry, writedisklabel(9) paniced. pointed out and fixed by Shuichiro URATA , thanks. --- sys/arch/arc/arc/disksubr.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sys/arch/arc/arc/disksubr.c b/sys/arch/arc/arc/disksubr.c index 5e53c893fd09..fad2003e3af0 100644 --- a/sys/arch/arc/arc/disksubr.c +++ b/sys/arch/arc/arc/disksubr.c @@ -1,4 +1,4 @@ -/* $NetBSD: disksubr.c,v 1.7 2000/01/23 21:01:51 soda Exp $ */ +/* $NetBSD: disksubr.c,v 1.8 2000/03/21 09:44:57 soda Exp $ */ /* $OpenBSD: disksubr.c,v 1.14 1997/05/08 00:14:29 deraadt Exp $ */ /* NetBSD: disksubr.c,v 1.40 1999/05/06 15:45:51 christos Exp */ @@ -451,13 +451,13 @@ writedisklabel(dev, strat, lp, osdep) if (ourdp == NO_MBR_SIGNATURE) goto nombrpart; - if (ourdp->mbrp_typ == MBR_PTYPE_OPENBSD) { - /* do not override OpenBSD disklabel */ - error = ESRCH; - goto done; - } - if (ourdp) { + if (ourdp->mbrp_typ == MBR_PTYPE_OPENBSD) { + /* do not override OpenBSD disklabel */ + error = ESRCH; + goto done; + } + /* need sector address for SCSI/IDE, cylinder for ESDI/ST506/RLL */ dospartoff = ourdp->mbrp_start;