Skip to content

Commit

Permalink
blk-mq: fix potential oops on out-of-memory in __blk_mq_alloc_rq_maps()
Browse files Browse the repository at this point in the history
__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>
  • Loading branch information
Jens Axboe committed Sep 22, 2014
1 parent a57a178 commit 6b55e1f
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion block/blk-mq.c
Original file line number Diff line number Diff line change
Expand Up @@ -1959,7 +1959,6 @@ static int __blk_mq_alloc_rq_maps(struct blk_mq_tag_set *set)
while (--i >= 0)
blk_mq_free_rq_map(set, set->tags[i], i);

set->tags = NULL;
return -ENOMEM;
}

Expand Down

0 comments on commit 6b55e1f

Please sign in to comment.