summaryrefslogtreecommitdiffstats
path: root/sys/scsi
diff options
context:
space:
mode:
authorats <ats@FreeBSD.org>1994-03-14 23:09:34 +0000
committerats <ats@FreeBSD.org>1994-03-14 23:09:34 +0000
commitdc139c903f4fe9f851efb33cb10cbd60ff89226b (patch)
tree61c5d64265bac6fd195a44ea68b1591cd4d32ae2 /sys/scsi
parentc81302a1219e06c150c5d36d3c804fee9af6eecc (diff)
downloadFreeBSD-src-dc139c903f4fe9f851efb33cb10cbd60ff89226b.zip
FreeBSD-src-dc139c903f4fe9f851efb33cb10cbd60ff89226b.tar.gz
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.
Diffstat (limited to 'sys/scsi')
-rw-r--r--sys/scsi/sd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c
index 5cf7daf..aee2076 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,
OpenPOWER on IntegriCloud