]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 24 Feb 2020 07:38:41 +0000 (08:38 +0100)
commita81d1c887b5c9f37200578e3d7bbb9134b6ef0a1
tree9e7c125ee52718714da8876eafa4d0ed1715e2dd
parent7f087d4603b939e16c97757c646beb4ed6d4bed9
bcache: rework error unwinding in register_bcache

[ Upstream commit 50246693f81fe887f4db78bf7089051d7f1894cc ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/md/bcache/super.c