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.
This commit is contained in:
Andreas Schulz 1994-03-14 23:09:34 +00:00
parent 943a66f340
commit d6e2315539
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=1263

View File

@ -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,