block, bfq: fix error handle in bfq_init

if elv_register fail, bfq_pool should be free.

Signed-off-by: weiping zhang <zhangweiping@didichuxing.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
weiping zhang 2017-08-19 00:37:20 +08:00 committed by Jens Axboe
parent 74d46992e0
commit 37dcd6570f

View File

@ -5062,10 +5062,12 @@ static int __init bfq_init(void)
ret = elv_register(&iosched_bfq_mq);
if (ret)
goto err_pol_unreg;
goto slab_kill;
return 0;
slab_kill:
bfq_slab_kill();
err_pol_unreg:
#ifdef CONFIG_BFQ_GROUP_IOSCHED
blkcg_policy_unregister(&blkcg_policy_bfq);