For this error handle, it should free both map and request, otherwise memleak occur. Signed-off-by: Weiping Zhang <zhangweiping@xxxxxxxxxxxxxx> --- 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 4692e8232699..406df9ce9b55 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -2990,7 +2990,7 @@ static int __blk_mq_alloc_rq_map_and_requests(struct blk_mq_tag_set *set) out_unwind: while (--i >= 0) - blk_mq_free_rq_map(set->tags[i]); + blk_mq_free_map_and_requests(set, i); return -ENOMEM; } -- 2.18.1