]> git.hungrycats.org Git - linux/commitdiff
[PATCH] blk: clear completion stack pointer on return
authorAndrew Morton <akpm@osdl.org>
Sat, 22 May 2004 03:38:40 +0000 (20:38 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Sat, 22 May 2004 03:38:40 +0000 (20:38 -0700)
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().

drivers/block/ll_rw_blk.c
drivers/ide/ide-io.c

index f3c9c06656adda072a87ed5a51c490f4614e840b..a9886f1fd207830cac596180525740b6d70f11c1 100644 (file)
@@ -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;
index 8ae49745556234ea17fb392476c0c65fdcc63066..37f95e14be98f5c8192cb880b73ba7ffd1511d1e 100644 (file)
@@ -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;