Skip to content

Commit

Permalink
blk-mq: Fix NULL pointer updating nr_requests
Browse files Browse the repository at this point in the history
A h/w context's tags are freed if it was not assigned a CPU. Check if
the context has tags before updating the depth.

Signed-off-by: Keith Busch <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
Keith Busch authored and axboe committed Mar 3, 2016
1 parent 6684167 commit e9137d4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions block/blk-mq.c
Original file line number Diff line number Diff line change
Expand Up @@ -2336,6 +2336,8 @@ int blk_mq_update_nr_requests(struct request_queue *q, unsigned int nr)

ret = 0;
queue_for_each_hw_ctx(q, hctx, i) {
if (!hctx->tags)
continue;
ret = blk_mq_tag_update_depth(hctx->tags, nr);
if (ret)
break;
Expand Down

0 comments on commit e9137d4

Please sign in to comment.