diff --git a/[refs] b/[refs] index cab7318ab9b6..34e3271a132c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: d5f840bf74c09ca5a31e518c9d984999926b5f44 +refs/heads/master: f505d49ffd25ed062e76ffd17568d3937fcd338c diff --git a/trunk/drivers/ide/ide-io.c b/trunk/drivers/ide/ide-io.c index 2ae02b8d7f8e..35dc38d3b2c5 100644 --- a/trunk/drivers/ide/ide-io.c +++ b/trunk/drivers/ide/ide-io.c @@ -102,11 +102,14 @@ void ide_complete_cmd(ide_drive_t *drive, struct ide_cmd *cmd, u8 stat, u8 err) drive->dev_flags |= IDE_DFLAG_PARKED; } - if (rq && rq->cmd_type == REQ_TYPE_ATA_TASKFILE) - memcpy(rq->special, cmd, sizeof(*cmd)); + if (rq && rq->cmd_type == REQ_TYPE_ATA_TASKFILE) { + struct ide_cmd *orig_cmd = rq->special; - if (cmd->tf_flags & IDE_TFLAG_DYN) - kfree(cmd); + if (cmd->tf_flags & IDE_TFLAG_DYN) + kfree(orig_cmd); + else + memcpy(orig_cmd, cmd, sizeof(*cmd)); + } } /* obsolete, blk_rq_bytes() should be used instead */