FreeBSD Bugzilla – Attachment 34936 Details for
Bug 56572
ATAng sees zero sized disk... causes div-by-zero
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 758 bytes, created by
David Gilbert
on 2003-09-07 21:10:12 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
David Gilbert
Created:
2003-09-07 21:10:12 UTC
Size:
758 bytes
patch
obsolete
>--- /sys/dev/ata/ata-disk.orig Sun Sep 7 15:41:06 2003 >+++ /sys/dev/ata/ata-disk.c Sun Sep 7 15:53:10 2003 >@@ -96,6 +96,16 @@ > adp->heads = atadev->param->heads; > adp->sectors = atadev->param->sectors; > adp->total_secs = atadev->param->cylinders * adp->heads * adp->sectors; >+ /* if the total sectors is zero, the size of the disk is zero >+ * and there's little good in attaching it (besides the fact >+ * that this would generate divide by zero errors later. >+ */ >+ if (adp->total_secs == 0) { >+ ata_prtdev(atadev, "FAILURE - total sectors 0\n"); >+ free(adp, M_AD); >+ atadev->attach = NULL; >+ return; >+ } > if (adp->device->channel->flags & ATA_USE_PC98GEOM && > adp->total_secs < 17 * 8 * 65536) { > adp->sectors = 17;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 56572
: 34936