提交 f50e5d67 编写于 作者: Y Yang Yingliang 提交者: Jens Axboe

ublk_drv: fix missing error return code in ublk_add_dev()

If blk_mq_init_queue() fails, it should return error code in ublk_add_dev()

Fixes: cebbe577 ("ublk_drv: fix request queue leak")
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Reviewed-by: NMing Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20220718042408.3132835-1-yangyingliang@huawei.comSigned-off-by: NJens Axboe <axboe@kernel.dk>
上级 f2450f8a
......@@ -1169,8 +1169,10 @@ static int ublk_add_dev(struct ublk_device *ub)
goto out_deinit_queues;
ub->ub_queue = blk_mq_init_queue(&ub->tag_set);
if (IS_ERR(ub->ub_queue))
if (IS_ERR(ub->ub_queue)) {
err = PTR_ERR(ub->ub_queue);
goto out_cleanup_tags;
}
ub->ub_queue->queuedata = ub;
disk = ub->ub_disk = blk_mq_alloc_disk_for_queue(ub->ub_queue,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册