aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-io.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-11 12:19:22 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-11 12:19:22 -0500
commiteedcdefb1ad75de9cc0889b247524be64cc244ef (patch)
tree763c742fe2ef0f109af364fca266f022739ef8bc /drivers/ide/ide-io.c
parent9585ca02f8f9e844b64e7ff4d167ccc1390a99ab (diff)
parent467390a2a50493332ddc21eb806094b1829c1161 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6: ide: remove stale comment from ide-lib.c ide: fix comment in init_irq() ide: ide_init_port() bugfix ide-disk: fix flush requests (take 2) ide: introduce CONFIG_BLK_DEV_IDEDMA_SFF option bast-ide: build fix ide-tape: remove never executed code ide: fix ide/legacy/gayle.c compilation ide-cd: replace ntohs with generic byteorder macro be16_to_cpu ide: remove stale version number pdc202xx_old: always enable burst mode palm_bk3710: use struct ide_port_info palm_bk3710: port initialization/probing bugfix palm_bk3710: fix ide_unregister() usage palm_bk3710: ide_register_hw() -> ide_device_add() ide: insert BUG_ON() into __ide_set_handler() (take 2) cs5520: remove stale comment ide: another possible ide panic fix for blk-end-request
Diffstat (limited to 'drivers/ide/ide-io.c')
-rw-r--r--drivers/ide/ide-io.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index 3addbe478d26..715379605a7b 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -361,17 +361,21 @@ void ide_end_drive_cmd (ide_drive_t *drive, u8 stat, u8 err)
361 spin_unlock_irqrestore(&ide_lock, flags); 361 spin_unlock_irqrestore(&ide_lock, flags);
362 362
363 if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) { 363 if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) {
364 ide_task_t *args = (ide_task_t *) rq->special; 364 ide_task_t *task = (ide_task_t *)rq->special;
365
365 if (rq->errors == 0) 366 if (rq->errors == 0)
366 rq->errors = !OK_STAT(stat,READY_STAT,BAD_STAT); 367 rq->errors = !OK_STAT(stat, READY_STAT, BAD_STAT);
367 368
368 if (args) { 369 if (task) {
369 struct ide_taskfile *tf = &args->tf; 370 struct ide_taskfile *tf = &task->tf;
370 371
371 tf->error = err; 372 tf->error = err;
372 tf->status = stat; 373 tf->status = stat;
373 374
374 ide_tf_read(drive, args); 375 ide_tf_read(drive, task);
376
377 if (task->tf_flags & IDE_TFLAG_DYN)
378 kfree(task);
375 } 379 }
376 } else if (blk_pm_request(rq)) { 380 } else if (blk_pm_request(rq)) {
377 struct request_pm_state *pm = rq->data; 381 struct request_pm_state *pm = rq->data;
@@ -388,7 +392,8 @@ void ide_end_drive_cmd (ide_drive_t *drive, u8 stat, u8 err)
388 spin_lock_irqsave(&ide_lock, flags); 392 spin_lock_irqsave(&ide_lock, flags);
389 HWGROUP(drive)->rq = NULL; 393 HWGROUP(drive)->rq = NULL;
390 rq->errors = err; 394 rq->errors = err;
391 if (__blk_end_request(rq, (rq->errors ? -EIO : 0), 0)) 395 if (unlikely(__blk_end_request(rq, (rq->errors ? -EIO : 0),
396 blk_rq_bytes(rq))))
392 BUG(); 397 BUG();
393 spin_unlock_irqrestore(&ide_lock, flags); 398 spin_unlock_irqrestore(&ide_lock, flags);
394} 399}