Commit cb79a0b2 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] blk: clear completion stack pointer on return

From: Jens Axboe <axboe@suse.de>

It doesn't always look safe to let ->waiting remain set when returning from
functions that set it to point to stack area, since various locations check
for != NULL to see if it's valid.  So clear it on return from
ide_do_drive_cmd() and blk_execute_rq().
parent 581ae915
......@@ -1876,6 +1876,7 @@ int blk_execute_rq(request_queue_t *q, struct gendisk *bd_disk,
elv_add_request(q, rq, ELEVATOR_INSERT_BACK, 1);
generic_unplug_device(q);
wait_for_completion(&wait);
rq->waiting = NULL;
if (rq->errors)
err = -EIO;
......
......@@ -1388,6 +1388,7 @@ int ide_do_drive_cmd (ide_drive_t *drive, struct request *rq, ide_action_t actio
err = 0;
if (must_wait) {
wait_for_completion(&wait);
rq->waiting = NULL;
if (rq->errors)
err = -EIO;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment