diff --git a/sys/boot/i386/libi386/biosdisk.c b/sys/boot/i386/libi386/biosdisk.c index 6d381d45cc70..25faefc32913 100644 --- a/sys/boot/i386/libi386/biosdisk.c +++ b/sys/boot/i386/libi386/biosdisk.c @@ -867,7 +867,7 @@ bd_read(struct open_disk *od, daddr_t dblk, int blks, caddr_t dest) */ x = min(FLOPPY_BOUNCEBUF, (unsigned)blks); bbuf = malloc(x * 2 * BIOSDISK_SECSIZE); - if (((u_int32_t)VTOP(bbuf) & 0xffff0000) == ((u_int32_t)VTOP(dest + x * BIOSDISK_SECSIZE) & 0xffff0000)) { + if (((u_int32_t)VTOP(bbuf) & 0xffff0000) == ((u_int32_t)VTOP(bbuf + x * BIOSDISK_SECSIZE) & 0xffff0000)) { breg = bbuf; } else { breg = bbuf + x * BIOSDISK_SECSIZE; @@ -1000,7 +1000,7 @@ bd_write(struct open_disk *od, daddr_t dblk, int blks, caddr_t dest) x = min(FLOPPY_BOUNCEBUF, (unsigned)blks); bbuf = malloc(x * 2 * BIOSDISK_SECSIZE); - if (((u_int32_t)VTOP(bbuf) & 0xffff0000) == ((u_int32_t)VTOP(dest + x * BIOSDISK_SECSIZE) & 0xffff0000)) { + if (((u_int32_t)VTOP(bbuf) & 0xffff0000) == ((u_int32_t)VTOP(bbuf + x * BIOSDISK_SECSIZE) & 0xffff0000)) { breg = bbuf; } else { breg = bbuf + x * BIOSDISK_SECSIZE;