Commit 37dcd657 authored by weiping zhang's avatar weiping zhang Committed by Jens Axboe

block, bfq: fix error handle in bfq_init

if elv_register fail, bfq_pool should be free.
Signed-off-by: default avatarweiping zhang <zhangweiping@didichuxing.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 74d46992
...@@ -5062,10 +5062,12 @@ static int __init bfq_init(void) ...@@ -5062,10 +5062,12 @@ static int __init bfq_init(void)
ret = elv_register(&iosched_bfq_mq); ret = elv_register(&iosched_bfq_mq);
if (ret) if (ret)
goto err_pol_unreg; goto slab_kill;
return 0; return 0;
slab_kill:
bfq_slab_kill();
err_pol_unreg: err_pol_unreg:
#ifdef CONFIG_BFQ_GROUP_IOSCHED #ifdef CONFIG_BFQ_GROUP_IOSCHED
blkcg_policy_unregister(&blkcg_policy_bfq); blkcg_policy_unregister(&blkcg_policy_bfq);
......
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