]> xenbits.xensource.com Git - seabios.git/commitdiff
disk: handle LBA I/O with zero sector count
authorKevin O'Connor <kevin@koconnor.net>
Sat, 11 Feb 2012 14:38:44 +0000 (09:38 -0500)
committerKevin O'Connor <kevin@koconnor.net>
Sat, 11 Feb 2012 14:38:44 +0000 (09:38 -0500)
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 <pbonzini@redhat.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
src/disk.c

index f2c662193aa435b2e47c4ecb095cbe436bd4aefd..29714d64df0ab47fe4ba62c14c63ce33691b00f4 100644 (file)
@@ -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);