From: Keith Busch Date: Sat, 20 Dec 2014 00:54:13 +0000 (-0700) Subject: blk-mq: Exit queue on alloc failure X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c76541a932113faa5b3be65a3f0a3d4ebbc86aeb;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git blk-mq: Exit queue on alloc failure Fixes usage counter when a request could not be allocated. Signed-off-by: Keith Busch Signed-off-by: Jens Axboe --- diff --git a/block/blk-mq.c b/block/blk-mq.c index da1ab5641227..bfe0f1f9cfa0 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -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);