[PATCH 3.19 016/101] blk-mq: fix use of incorrect goto label in blk_mq_init_queue error path
From: Greg Kroah-Hartman
Date: Fri Apr 17 2015 - 10:03:50 EST
3.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mike Snitzer <snitzer@xxxxxxxxxx>
commit 9a30b096b543932de218dd3501b5562e00a8792d upstream.
If percpu_ref_init() fails the allocated q and hctxs must get cleaned
up; using 'err_map' doesn't allow that to happen.
Signed-off-by: Mike Snitzer <snitzer@xxxxxxxxxx>
Reviewed-by: Ming Lei <ming.lei@xxxxxxxxxxxxx>
Signed-off-by: Jens Axboe <axboe@xxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
block/blk-mq.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -1937,7 +1937,7 @@ struct request_queue *blk_mq_init_queue(
*/
if (percpu_ref_init(&q->mq_usage_counter, blk_mq_usage_counter_release,
PERCPU_REF_INIT_ATOMIC, GFP_KERNEL))
- goto err_map;
+ goto err_mq_usage;
setup_timer(&q->timeout, blk_mq_rq_timer, (unsigned long) q);
blk_queue_rq_timeout(q, 30000);
@@ -1980,7 +1980,7 @@ struct request_queue *blk_mq_init_queue(
blk_mq_init_cpu_queues(q, set->nr_hw_queues);
if (blk_mq_init_hw_queues(q, set))
- goto err_hw;
+ goto err_mq_usage;
mutex_lock(&all_q_mutex);
list_add_tail(&q->all_q_node, &all_q_list);
@@ -1992,7 +1992,7 @@ struct request_queue *blk_mq_init_queue(
return q;
-err_hw:
+err_mq_usage:
blk_cleanup_queue(q);
err_hctxs:
kfree(map);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/