OSDN Git Service

blk-mq: fix allocation of set->tags
authorMing Lei <tom.leiming@gmail.com>
Sat, 19 Apr 2014 10:00:17 +0000 (18:00 +0800)
committerJens Axboe <axboe@fb.com>
Mon, 21 Apr 2014 16:38:36 +0000 (10:38 -0600)
type of set->tags is struct blk_mq_tags **.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
block/blk-mq.c

index 5fbbb22..c277797 100644 (file)
@@ -1537,7 +1537,8 @@ int blk_mq_alloc_tag_set(struct blk_mq_tag_set *set)
                return -EINVAL;
 
 
-       set->tags = kmalloc_node(set->nr_hw_queues * sizeof(struct blk_mq_tags),
+       set->tags = kmalloc_node(set->nr_hw_queues *
+                                sizeof(struct blk_mq_tags *),
                                 GFP_KERNEL, set->numa_node);
        if (!set->tags)
                goto out;