Subject: [PATCH 1775/2944] blk-mq: fix allocation for queue mapping table

From: Ming Lei <[email-masked]>
Date: Mon, 17 Dec 2018 18:42:45 +0800

to #28991349

commit 07b35eb5a364fa59f88f65e6c786192f2c9163be upstream

Type of each element in queue mapping table is 'unsigned int,
intead of 'struct blk_mq_queue_map)', so fix it.

Cc: Jeff Moyer <[email-masked]>
Cc: Mike Snitzer <[email-masked]>
Cc: Christoph Hellwig <[email-masked]>
Reviewed-by: Christoph Hellwig <[email-masked]>
Signed-off-by: Ming Lei <[email-masked]>
Signed-off-by: Jens Axboe <[email-masked]>
Signed-off-by: Xiaoguang Wang <[email-masked]>
Reviewed-by: Joseph Qi <[email-masked]>
---
 block/blk-mq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/blk-mq.c b/block/blk-mq.c
index bdfbd0a..68fbcf9 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -2985,7 +2985,7 @@ int blk_mq_alloc_tag_set(struct blk_mq_tag_set *set)
 	ret = -ENOMEM;
 	for (i = 0; i < set->nr_maps; i++) {
 		set->map[i].mq_map = kcalloc_node(nr_cpu_ids,
-						  sizeof(struct blk_mq_queue_map),
+						  sizeof(set->map[i].mq_map[0]),
 						  GFP_KERNEL, set->numa_node);
 		if (!set->map[i].mq_map)
 			goto out_free_mq_map;
-- 
1.8.3.1