]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
blk-mq: fix potential oops on out-of-memory in __blk_mq_alloc_rq_maps()
authorJens Axboe <axboe@fb.com>
Fri, 19 Sep 2014 14:04:53 +0000 (08:04 -0600)
committerJens Axboe <axboe@fb.com>
Mon, 22 Sep 2014 17:55:23 +0000 (11:55 -0600)
__blk_mq_alloc_rq_maps() can be invoked multiple times, if we scale
back the queue depth if we are low on memory. So don't clear
set->tags when we fail, this is handled directly in
the parent function, blk_mq_alloc_tag_set().

Reported-by: Robert Elliott <Elliott@hp.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
block/blk-mq.c

index a7d70a1bbf3677da45a4be57056f5971a8853a6b..e83d306907dafba44d77e0c0bfa4e9bf877b8bec 100644 (file)
@@ -1959,7 +1959,6 @@ out_unwind:
        while (--i >= 0)
                blk_mq_free_rq_map(set, set->tags[i], i);
 
-       set->tags = NULL;
        return -ENOMEM;
 }