volume: Catch xfer_size==0 condition in cache_block()
diff --git a/stage23/lib/part.s2.c b/stage23/lib/part.s2.c
index 024c82e0..8e089ac0 100644
--- a/stage23/lib/part.s2.c
+++ b/stage23/lib/part.s2.c
@@ -38,6 +38,9 @@ static bool cache_block(struct volume *volume, uint64_t block) {
first_sect + block * volume->fastest_xfer_size,
xfer_size)) {
xfer_size--;
+ if (xfer_size == 0) {
+ return false;
+ }
}
volume->cache_status = CACHE_READY;
