blk-cgroup: fix missing put device in error path from blkg_conf_pref()
authorYu Kuai <yukuai3@huawei.com>
Tue, 2 Nov 2021 02:07:05 +0000 (10:07 +0800)
committerJens Axboe <axboe@kernel.dk>
Fri, 19 Nov 2021 13:26:45 +0000 (06:26 -0700)
commit15c30104965101b8e76b24d27035569d6613a7d6
treee5033b346313dc217878e56250db2ff47cd16dc4
parent245a489e81e13dd55ae46d27becf6d5901eb7828
blk-cgroup: fix missing put device in error path from blkg_conf_pref()

If blk_queue_enter() failed due to queue is dying, the
blkdev_put_no_open() is needed because blkcg_conf_open_bdev() succeeded.

Fixes: 0c9d338c8443 ("blk-cgroup: synchronize blkg creation against policy deactivation")
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Acked-by: Tejun Heo <tj@kernel.org>
Link: https://lore.kernel.org/r/20211102020705.2321858-1-yukuai3@huawei.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-cgroup.c