From c3a1d09768d20495f75e59ddfb146a050c2b99f1 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Thu, 30 Apr 1998 04:55:47 +0000 Subject: Only use scsi geometry to fake up a label if we were able to get the capacity. Fixes a panic with fictitious labels on zip drives. --- sys/arch/hp300/dev/sd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sys/arch/hp300') diff --git a/sys/arch/hp300/dev/sd.c b/sys/arch/hp300/dev/sd.c index 78de6345edb..6ca16d60237 100644 --- a/sys/arch/hp300/dev/sd.c +++ b/sys/arch/hp300/dev/sd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sd.c,v 1.15 1998/04/25 00:38:15 millert Exp $ */ +/* $OpenBSD: sd.c,v 1.16 1998/04/30 04:55:46 millert Exp $ */ /* $NetBSD: sd.c,v 1.34 1997/07/10 18:14:10 kleink Exp $ */ /* @@ -435,7 +435,8 @@ sdgetinfo(dev) sc->sc_blksize = DEV_BSIZE; /* Fill in info from disk geometry if it exists. */ - if (sc->sc_blks != 0 && sc->sc_heads != 0 && sc->sc_cyls != 0) { + if (sc->sc_format_pid >= 0 && sc->sc_blks > 0 && + sc->sc_heads > 0 && sc->sc_cyls > 0) { lp->d_secperunit = sc->sc_blks >> sc->sc_bshift; lp->d_ntracks = sc->sc_heads; lp->d_ncylinders = sc->sc_cyls; -- cgit v1.2.3