From: Kevin O'Connor Date: Sat, 11 Feb 2012 14:38:44 +0000 (-0500) Subject: disk: handle LBA I/O with zero sector count X-Git-Tag: rel-1.7.0~53 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=b50488bb3912f50ac70055d3fc3200ff2303986b;p=seabios.git 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 --- 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);