summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToomas Soome <tsoome@me.com>2018-08-03 08:03:31 +0300
committerRobert Mustacchi <rm@joyent.com>2018-08-29 02:07:12 +0000
commit570479901769888c6a35dcd8d94242a926d0bd87 (patch)
treef0d9ca6d31ba33fde7e1055ae1639aa511d4c649
parent322e343b7c538c565d91cb11d00fbe6266834e28 (diff)
downloadillumos-joyent-570479901769888c6a35dcd8d94242a926d0bd87.tar.gz
9699 loader: biosdisk should prefer smaller (safer) sectors value from INT13
Reviewed by: Andy Fiddaman <omnios@citrus-it.co.uk> Reviewed by: Yuri Pankov <yuripv@yuripv.net> Approved by: Robert Mustacchi <rm@joyent.com>
-rw-r--r--usr/src/boot/sys/boot/i386/libi386/biosdisk.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr/src/boot/sys/boot/i386/libi386/biosdisk.c b/usr/src/boot/sys/boot/i386/libi386/biosdisk.c
index 6218465960..598cef6814 100644
--- a/usr/src/boot/sys/boot/i386/libi386/biosdisk.c
+++ b/usr/src/boot/sys/boot/i386/libi386/biosdisk.c
@@ -269,7 +269,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;