Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c76541a9 authored by Keith Busch's avatar Keith Busch Committed by Jens Axboe
Browse files

blk-mq: Exit queue on alloc failure



Fixes usage counter when a request could not be allocated.

Signed-off-by: default avatarKeith Busch <keith.busch@intel.com>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent ecb5ec04
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -258,8 +258,10 @@ struct request *blk_mq_alloc_request(struct request_queue *q, int rw, gfp_t gfp,
		ctx = alloc_data.ctx;
	}
	blk_mq_put_ctx(ctx);
	if (!rq)
	if (!rq) {
		blk_mq_queue_exit(q);
		return ERR_PTR(-EWOULDBLOCK);
	}
	return rq;
}
EXPORT_SYMBOL(blk_mq_alloc_request);