From: Keith Busch Date: Thu, 18 Feb 2016 21:56:35 +0000 (-0700) Subject: blk-mq: Fix NULL pointer updating nr_requests X-Git-Tag: v4.6-rc1~97^2~6 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=e9137d4b93078b6a9965acfb18a2a2ad91cf8405;p=linux.git 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 Signed-off-by: Jens Axboe --- 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;