Files
i2som-imx-linux/block
Roland Dreier 32eb44e290 block: Don't access request after it might be freed
commit 893d290f1d upstream.

After we've done __elv_add_request() and __blk_run_queue() in
blk_execute_rq_nowait(), the request might finish and be freed
immediately.  Therefore checking if the type is REQ_TYPE_PM_RESUME
isn't safe afterwards, because if it isn't, rq might be gone.
Instead, check beforehand and stash the result in a temporary.

This fixes crashes in blk_execute_rq_nowait() I get occasionally when
running with lots of memory debugging options enabled -- I think this
race is usually harmless because the window for rq to be reallocated
is so small.

Signed-off-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2012-12-06 11:20:35 +00:00
..
2012-08-02 14:37:54 +01:00
2012-08-02 14:37:54 +01:00
2011-12-29 09:16:28 +01:00
2012-08-02 14:37:54 +01:00
2012-08-02 14:37:54 +01:00
2012-03-12 12:31:36 -07:00
2011-07-31 22:05:09 +02:00
2011-07-31 22:05:09 +02:00