]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
bcache: Fix leak of bdev reference
authorJan Kara <jack@suse.cz>
Wed, 6 Sep 2017 06:25:51 +0000 (14:25 +0800)
committerSeth Forshee <seth.forshee@canonical.com>
Thu, 28 Sep 2017 14:36:13 +0000 (10:36 -0400)
commit63cc769c4fbcbcff06cf238441919c006c365c0f
tree08c186a1808c0987835498afcf1db7b409894203
parent5c32e546b9482f53dc1318814611f53e03ae46df
bcache: Fix leak of bdev reference

BugLink: http://bugs.launchpad.net/bugs/1720154
commit 4b758df21ee7081ab41448d21d60367efaa625b3 upstream.

If blkdev_get_by_path() in register_bcache() fails, we try to lookup the
block device using lookup_bdev() to detect which situation we are in to
properly report error. However we never drop the reference returned to
us from lookup_bdev(). Fix that.

Signed-off-by: Jan Kara <jack@suse.cz>
Acked-by: Coly Li <colyli@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
drivers/md/bcache/super.c