aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/ide/ide-disk.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index ca934c8a1289..c998cf8e971a 100644
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -227,7 +227,7 @@ static u64 idedisk_read_native_max_address(ide_drive_t *drive, int lba48)
227 ide_no_data_taskfile(drive, &cmd); 227 ide_no_data_taskfile(drive, &cmd);
228 228
229 /* if OK, compute maximum address value */ 229 /* if OK, compute maximum address value */
230 if ((tf->status & 0x01) == 0) 230 if (!(tf->status & ATA_ERR))
231 addr = ide_get_lba_addr(tf, lba48) + 1; 231 addr = ide_get_lba_addr(tf, lba48) + 1;
232 232
233 return addr; 233 return addr;
@@ -267,7 +267,7 @@ static u64 idedisk_set_max_address(ide_drive_t *drive, u64 addr_req, int lba48)
267 ide_no_data_taskfile(drive, &cmd); 267 ide_no_data_taskfile(drive, &cmd);
268 268
269 /* if OK, compute maximum address value */ 269 /* if OK, compute maximum address value */
270 if ((tf->status & 0x01) == 0) 270 if (!(tf->status & ATA_ERR))
271 addr_set = ide_get_lba_addr(tf, lba48) + 1; 271 addr_set = ide_get_lba_addr(tf, lba48) + 1;
272 272
273 return addr_set; 273 return addr_set;