aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2026-07-10 04:04:30 +0000
committerWarner Losh <imp@FreeBSD.org>2026-07-10 04:09:41 +0000
commit603270b4d69ecf0a8405e34bd41838873ddad72d (patch)
tree05d7bef154d4ed0977beefcbd08054c20631a48d
parenta22fa5ec74e084c5786745e56939e78f7159007b (diff)
loader.efi: Fix off by one error in size of the virtual disk
The end address is the final byte in the array, not one byte past the end of the array, so we need to add 1 to get the full length. Fixes: 59219fc76a4b ("loader.efi: efiblk_memdisk_preload passes the VirtualDisks to FreeBSD") Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D58069
-rw-r--r--stand/efi/libefi/efipart.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/stand/efi/libefi/efipart.c b/stand/efi/libefi/efipart.c
index b4842e1b52aa..c80a3b966376 100644
--- a/stand/efi/libefi/efipart.c
+++ b/stand/efi/libefi/efipart.c
@@ -1292,7 +1292,7 @@ efiblk_memdisk_preload(void)
snprintf(value, sizeof(value), "0x%016x", start);
setenv(key, value, 1);
snprintf(key, sizeof(key), "hint.md.%d.len", i);
- snprintf(value, sizeof(value), "0x%016x", end - start);
+ snprintf(value, sizeof(value), "%d", end - start + 1);
setenv(key, value, 1);
}
}