summaryrefslogtreecommitdiff
path: root/drivers/md
diff options
context:
space:
mode:
authorZheng Liu <wenqing.lz@taobao.com>2015-11-30 04:21:57 +0300
committerSasha Levin <sasha.levin@oracle.com>2016-02-10 06:56:16 +0300
commitde406db368382f0f93beddfbd39a46c8fead5eec (patch)
tree2fed5d7e247de49b7e3ac20f815448a6d4f8f63b /drivers/md
parentf997a6ac49a7de81cff6c9a44223a7537744a11d (diff)
downloadlinux-de406db368382f0f93beddfbd39a46c8fead5eec.tar.xz
bcache: unregister reboot notifier if bcache fails to unregister device
[ Upstream commit 2ecf0cdb2b437402110ab57546e02abfa68a716b ] In bcache_init() function it forgot to unregister reboot notifier if bcache fails to unregister a block device. This commit fixes this. Signed-off-by: Zheng Liu <wenqing.lz@taobao.com> Tested-by: Joshua Schmid <jschmid@suse.com> Tested-by: Eric Wheeler <bcache@linux.ewheeler.net> Cc: Kent Overstreet <kmo@daterainc.com> Cc: stable@vger.kernel.org Signed-off-by: Jens Axboe <axboe@fb.com> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/bcache/super.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
index 9d7b6ee454af..53f15126182a 100644
--- a/drivers/md/bcache/super.c
+++ b/drivers/md/bcache/super.c
@@ -2105,8 +2105,10 @@ static int __init bcache_init(void)
closure_debug_init();
bcache_major = register_blkdev(0, "bcache");
- if (bcache_major < 0)
+ if (bcache_major < 0) {
+ unregister_reboot_notifier(&reboot);
return bcache_major;
+ }
if (!(bcache_wq = create_workqueue("bcache")) ||
!(bcache_kobj = kobject_create_and_add("bcache", fs_kobj)) ||