From d6e2315539e08b42e0237e1f140105509c413901 Mon Sep 17 00:00:00 2001 From: Andreas Schulz Date: Mon, 14 Mar 1994 23:09:34 +0000 Subject: [PATCH] Put a safety check in for the secsiz divide for the MB printf. Else we get a panic integer divide fault in the kernel if the drive returns a bogus zero secsize. --- sys/scsi/sd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c index 5cf7daf510cd..aee2076789ee 100644 --- a/sys/scsi/sd.c +++ b/sys/scsi/sd.c @@ -14,7 +14,7 @@ * * Ported to run under 386BSD by Julian Elischer (julian@dialix.oz.au) Sept 1992 * - * $Id: sd.c,v 1.17 1994/01/29 10:30:39 rgrimes Exp $ + * $Id: sd.c,v 1.18 1994/01/29 11:17:10 davidg Exp $ */ #define SPLSD splbio @@ -183,7 +183,7 @@ sdattach(sc_link) sd_get_parms(unit, SCSI_NOSLEEP | SCSI_NOMASK); printf("sd%d: %dMB (%d total sec), %d cyl, %d head, %d sec, bytes/sec %d\n", unit, - dp->disksize / ((1024L * 1024L) / dp->secsiz), + dp->secsiz ? dp->disksize / ((1024L * 1024L) / dp->secsiz) : 0, dp->disksize, dp->cyls, dp->heads,