projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d5f840b
)
ide: fix barriers support
author
Bartlomiej Zolnierkiewicz
<
[email protected]
>
Sat, 18 Apr 2009 15:42:20 +0000
(17:42 +0200)
committer
Bartlomiej Zolnierkiewicz
<
[email protected]
>
Sat, 18 Apr 2009 15:42:20 +0000
(17:42 +0200)
Freeing non-slab objects is bad and results in an oops. Fix it.
Reported-and-tested-by: Andrew Price <
[email protected]
>
Cc: Theodore Tso <
[email protected]
>
Cc: "Rafael J. Wysocki" <
[email protected]
>
Signed-off-by: Bartlomiej Zolnierkiewicz <
[email protected]
>
drivers/ide/ide-io.c
patch
|
blob
|
history
diff --git
a/drivers/ide/ide-io.c
b/drivers/ide/ide-io.c
index 2ae02b8d7f8e06e7551f352f0336ea8089db97ad..35dc38d3b2c58d2f40e3a299f5b6c0832f88da82 100644
(file)
--- a/
drivers/ide/ide-io.c
+++ b/
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 */