Merge branch 'for-2.6.37/core' of git://git.kernel.dk/linux-2.6-block
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 23 Oct 2010 18:55:00 +0000 (11:55 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 23 Oct 2010 18:55:00 +0000 (11:55 -0700)
* 'for-2.6.37/core' of git://git.kernel.dk/linux-2.6-block:
  block: fix use-after-free bug in blk throttle code

block/blk-core.c
block/blk-sysfs.c

index 45141469e89eba5f24c9594afdfa5218e5688f46..51efd835d4cffa3d1fc1dc80b4aad87b41820498 100644 (file)
@@ -462,8 +462,6 @@ void blk_cleanup_queue(struct request_queue *q)
        if (q->elevator)
                elevator_exit(q->elevator);
 
-       blk_throtl_exit(q);
-
        blk_put_queue(q);
 }
 EXPORT_SYMBOL(blk_cleanup_queue);
index da8a8a40cd4c3596762590da48a6c823f62f9fb4..013457f47fdc8b12eded858c852f588884b962c5 100644 (file)
@@ -471,6 +471,8 @@ static void blk_release_queue(struct kobject *kobj)
 
        blk_sync_queue(q);
 
+       blk_throtl_exit(q);
+
        if (rl->rq_pool)
                mempool_destroy(rl->rq_pool);