From b50488bb3912f50ac70055d3fc3200ff2303986b Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Sat, 11 Feb 2012 09:38:44 -0500 Subject: [PATCH] disk: handle LBA I/O with zero sector count Unlike basic_access, extended_access does not check for a zero sector count. However, this is a problem because for example it would be interpreted as 256 when processing an ATA request. Based on patch from: Paolo Bonzini Signed-off-by: Kevin O'Connor --- src/disk.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/disk.c b/src/disk.c index f2c6621..29714d6 100644 --- a/src/disk.c +++ b/src/disk.c @@ -135,6 +135,11 @@ extended_access(struct bregs *regs, struct drive_s *drive_g, u16 command) dop.buf_fl = SEGOFF_TO_FLATPTR(GET_INT13EXT(regs, data)); dop.count = GET_INT13EXT(regs, count); + if (! dop.count) { + // Nothing to do. + disk_ret(regs, DISK_RET_SUCCESS); + return; + } int status = send_disk_op(&dop); -- 2.39.5