projects
/
GitHub
/
exynos8895
/
android_kernel_samsung_universal8895.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
959a35f
)
blk-mq: fix use-after-free of request
author
Ming Lei
<tom.leiming@gmail.com>
Thu, 5 Dec 2013 17:50:39 +0000
(10:50 -0700)
committer
Jens Axboe
<axboe@kernel.dk>
Thu, 5 Dec 2013 17:50:39 +0000
(10:50 -0700)
If accounting is on, we will do the IO completion accounting after
we have freed the request. Fix that by moving it sooner instead.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-mq.c
patch
|
blob
|
blame
|
history
diff --git
a/block/blk-mq.c
b/block/blk-mq.c
index 70fd6f9966006f185492be2483d7656fab725a52..c79126e110308e8b1ea4b322506a425ceeb3085c 100644
(file)
--- a/
block/blk-mq.c
+++ b/
block/blk-mq.c
@@
-312,12
+312,12
@@
void blk_mq_complete_request(struct request *rq, int error)
blk_account_io_completion(rq, bytes);
+ blk_account_io_done(rq);
+
if (rq->end_io)
rq->end_io(rq, error);
else
blk_mq_free_request(rq);
-
- blk_account_io_done(rq);
}
void __blk_mq_end_io(struct request *rq, int error)