]> git.baikalelectronics.ru Git - kernel.git/commit
blk-mq-sched: Fix blk_mq_sched_alloc_tags() error handling
authorJohn Garry <john.garry@huawei.com>
Tue, 27 Jul 2021 09:32:53 +0000 (17:32 +0800)
committerJens Axboe <axboe@kernel.dk>
Tue, 27 Jul 2021 22:44:38 +0000 (16:44 -0600)
commit8f8105f158ea49fb43e5ca41b6f5ed5a38d48e77
tree6a0f83ecb4efae850ef4fc13dc98da2c707327f2
parentdcc1a4639299e5b72be43c5241fd305dbb90e8e0
blk-mq-sched: Fix blk_mq_sched_alloc_tags() error handling

If the blk_mq_sched_alloc_tags() -> blk_mq_alloc_rqs() call fails, then we
call blk_mq_sched_free_tags() -> blk_mq_free_rqs().

It is incorrect to do so, as any rqs would have already been freed in the
blk_mq_alloc_rqs() call.

Fix by calling blk_mq_free_rq_map() only directly.

Fixes: 06e81096048a7 ("blk-mq-sched: refactor scheduler initialization")
Signed-off-by: John Garry <john.garry@huawei.com>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/1627378373-148090-1-git-send-email-john.garry@huawei.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-mq-sched.c