diff options
author | Keith Busch <keith.busch@intel.com> | 2016-02-18 14:56:35 -0700 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2016-03-03 14:46:04 -0700 |
commit | e9137d4b93078b6a9965acfb18a2a2ad91cf8405 (patch) | |
tree | 0633fc205e9f520315c268a3ca165866cc9421fc | |
parent | 66841672161efb9e3be4a1dbd9755020bb1d86b7 (diff) | |
download | linux-stable-e9137d4b93078b6a9965acfb18a2a2ad91cf8405.tar.gz linux-stable-e9137d4b93078b6a9965acfb18a2a2ad91cf8405.tar.bz2 linux-stable-e9137d4b93078b6a9965acfb18a2a2ad91cf8405.zip |
blk-mq: Fix NULL pointer updating nr_requests
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 <keith.busch@intel.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
-rw-r--r-- | block/blk-mq.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c index f539a53d16c3..5667f59c277c 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -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; |