efi: Skip devices with block size of 0

Fixes a Haiku loader crash (division by zero) on HP Chromebook YAVIKS

Change-Id: I88bef370ca4848862003b6f54ddae6d2f9b0a854
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10268
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
This commit is contained in:
Adam Słaboń
2026-01-26 16:55:27 +00:00
committed by Adrien Destugues
parent 5342045e20
commit 44cdc0420b
+3 -1
View File
@@ -228,7 +228,9 @@ platform_add_boot_device(struct stage2_args *args, NodeList *devicesList)
blockIo->Media->RemovableMedia ? "true" : "false",
blockIo->Media->BlockSize, blockIo->Media->LastBlock);
if (!blockIo->Media->MediaPresent || blockIo->Media->LogicalPartition)
if (!blockIo->Media->MediaPresent
|| blockIo->Media->LogicalPartition
|| blockIo->Media->BlockSize == 0)
continue;
// The qemu flash device with a 256K block sizes sometime show up