Added a sanity check to hdd_seek_get_time().
This commit is contained in:
@@ -161,6 +161,10 @@ hdd_seek_get_time(hard_disk_t *hdd, uint32_t dst_addr, uint8_t operation, uint8_
|
|||||||
return HDD_OVERHEAD_TIME;
|
return HDD_OVERHEAD_TIME;
|
||||||
|
|
||||||
hdd_zone_t *zone = NULL;
|
hdd_zone_t *zone = NULL;
|
||||||
|
if (hdd->num_zones <= 0) {
|
||||||
|
fatal("hdd_seek_get_time(): hdd->num_zones < 0)\n");
|
||||||
|
return 0.0;
|
||||||
|
}
|
||||||
for (int i = 0; i < hdd->num_zones; i++) {
|
for (int i = 0; i < hdd->num_zones; i++) {
|
||||||
zone = &hdd->zones[i];
|
zone = &hdd->zones[i];
|
||||||
if (zone->end_sector >= dst_addr)
|
if (zone->end_sector >= dst_addr)
|
||||||
|
Reference in New Issue
Block a user