From e9137d4b93078b6a9965acfb18a2a2ad91cf8405 Mon Sep 17 00:00:00 2001 From: Keith Busch Date: Thu, 18 Feb 2016 14:56:35 -0700 Subject: 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 --- block/blk-mq.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'block') 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; -- cgit v1.2.3