diff options
author | Mike Snitzer <snitzer@redhat.com> | 2015-03-12 23:53:26 -0400 |
---|---|---|
committer | Sasha Levin <sasha.levin@oracle.com> | 2015-04-22 23:32:10 -0400 |
commit | 06767df2716dd228bc94696862f165d14e5cc756 (patch) | |
tree | 73b342f0fd48385029cd3ba8e582f5f37950c6fd /block | |
parent | 9da02d84fe5007faeb7bf9f1fbca93960ecf192c (diff) | |
download | linux-stable-06767df2716dd228bc94696862f165d14e5cc756.tar.gz linux-stable-06767df2716dd228bc94696862f165d14e5cc756.tar.bz2 linux-stable-06767df2716dd228bc94696862f165d14e5cc756.zip |
blk-mq: fix use of incorrect goto label in blk_mq_init_queue error path
[ Upstream commit 9a30b096b543932de218dd3501b5562e00a8792d ]
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@redhat.com>
Reviewed-by: Ming Lei <ming.lei@canonical.com>
Cc: stable@kernel.org
Signed-off-by: Jens Axboe <axboe@fb.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Diffstat (limited to 'block')
-rw-r--r-- | block/blk-mq.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c index 1d016fc9a8b6..849479debac3 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -1831,7 +1831,7 @@ struct request_queue *blk_mq_init_queue(struct blk_mq_tag_set *set) */ 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); @@ -1874,7 +1874,7 @@ struct request_queue *blk_mq_init_queue(struct blk_mq_tag_set *set) 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); @@ -1886,7 +1886,7 @@ struct request_queue *blk_mq_init_queue(struct blk_mq_tag_set *set) return q; -err_hw: +err_mq_usage: blk_cleanup_queue(q); err_hctxs: kfree(map); |