blk-mq: Fix NULL pointer updating nr_requests
authorKeith Busch <keith.busch@intel.com>
Thu, 18 Feb 2016 21:56:35 +0000 (14:56 -0700)
committerJens Axboe <axboe@fb.com>
Thu, 3 Mar 2016 21:46:04 +0000 (14:46 -0700)
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>
block/blk-mq.c

index f539a53..5667f59 100644 (file)
@@ -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;