Message ID | CAF1ivSYD88gsiAWQkcH-af07-HCVYzQrFcxpGhejLxcmr0WHrw@mail.gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
diff --git a/block/blk-mq.c b/block/blk-mq.c index 7bb45ed..b59d2ef 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -279,6 +279,11 @@ struct request *blk_mq_alloc_request_hctx(struct request_queue *q, int rw, if (ret) return ERR_PTR(ret); + if (hctx_idx >= q->nr_hw_queues) { + blk_queue_exit(q); + return ERR_PTR(-EINVAL); + } + hctx = q->queue_hw_ctx[hctx_idx]; ctx = __blk_mq_get_ctx(q, cpumask_first(hctx->cpumask));