Commit 33dc6279 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

blk-cgroup: fix error unwinding in blkcg_init_queue

When blk_throtl_init fails, we need to call blk_ioprio_exit.  Switch to
proper goto based unwinding to fix this.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarAndreas Herrmann <aherrmann@suse.de>
Acked-by: default avatarTejun Heo <tj@kernel.org>
Link: https://lore.kernel.org/r/20220921180501.1539876-2-hch@lst.deSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent f168420c
...@@ -1297,17 +1297,18 @@ int blkcg_init_queue(struct request_queue *q) ...@@ -1297,17 +1297,18 @@ int blkcg_init_queue(struct request_queue *q)
ret = blk_throtl_init(q); ret = blk_throtl_init(q);
if (ret) if (ret)
goto err_destroy_all; goto err_ioprio_exit;
ret = blk_iolatency_init(q); ret = blk_iolatency_init(q);
if (ret) { if (ret)
blk_throtl_exit(q); goto err_throtl_exit;
blk_ioprio_exit(q);
goto err_destroy_all;
}
return 0; return 0;
err_throtl_exit:
blk_throtl_exit(q);
err_ioprio_exit:
blk_ioprio_exit(q);
err_destroy_all: err_destroy_all:
blkg_destroy_all(q); blkg_destroy_all(q);
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment