diff --git a/stand/i386/libi386/biosdisk.c b/stand/i386/libi386/biosdisk.c index 1e819033b4e3..a6a8c98d64aa 100644 --- a/stand/i386/libi386/biosdisk.c +++ b/stand/i386/libi386/biosdisk.c @@ -275,7 +275,7 @@ bd_int13probe(struct bdinfo *bd) total = (uint64_t)params.cylinders * params.heads * params.sectors_per_track; - if (bd->bd_sectors > total) + if (total > 0 && bd->bd_sectors > total) bd->bd_sectors = total; ret = 1;