If current_heads or current_sectors in the disk cap page are zero, dont try to use the current_ geometry.
This avoids a panic with BIOS'n that sets these to zero.
This commit is contained in:
parent
3c5b80d6c2
commit
abd7633203
@ -105,7 +105,8 @@ ad_attach(device_t dev)
|
||||
}
|
||||
device_set_ivars(dev, adp);
|
||||
|
||||
if (atadev->param.atavalid & ATA_FLAG_54_58) {
|
||||
if ((atadev->param.atavalid & ATA_FLAG_54_58) &&
|
||||
atadev->param.current_heads && atadev->param.current_sectors) {
|
||||
adp->heads = atadev->param.current_heads;
|
||||
adp->sectors = atadev->param.current_sectors;
|
||||
adp->total_secs = (u_int32_t)atadev->param.current_size_1 |
|
||||
|
Loading…
Reference in New Issue
Block a user