]> git.baikalelectronics.ru Git - kernel.git/commit
bcache: rework error unwinding in register_bcache
authorChristoph Hellwig <hch@lst.de>
Thu, 23 Jan 2020 17:01:28 +0000 (01:01 +0800)
committerJens Axboe <axboe@kernel.dk>
Thu, 23 Jan 2020 18:40:01 +0000 (11:40 -0700)
commit505be110f2119348892e5ca72aa553f48a7e829b
treeb0ad1f8d4099ea59194c6efea8fd38806ce6a83c
parent0c7deaf26d9872e29a04ec5d34257b5d31118ee4
bcache: rework error unwinding in register_bcache

Split the successful and error return path, and use one goto label for each
resource to unwind.  This also fixes some small errors like leaking the
module reference count in the reboot case (which seems entirely harmless)
or printing the wrong warning messages for early failures.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Coly Li <colyli@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/md/bcache/super.c