Skip to content

Commit 820d220

Browse files
James MorrisLinus Torvalds
authored andcommitted
[PATCH] Fix capifs bug in initialization error path.
This fixes a bug in the capifs initialization code, where the filesystem is not unregistered if kern_mount() fails. Signed-off-by: James Morris <jmorris@namei.org> Signed-off-by: Karsten Keil <kkeil@suse.de> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
1 parent 8dbddf1 commit 820d220

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/isdn/capi/capifs.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,10 @@ static int __init capifs_init(void)
191191
err = register_filesystem(&capifs_fs_type);
192192
if (!err) {
193193
capifs_mnt = kern_mount(&capifs_fs_type);
194-
if (IS_ERR(capifs_mnt))
194+
if (IS_ERR(capifs_mnt)) {
195195
err = PTR_ERR(capifs_mnt);
196+
unregister_filesystem(&capifs_fs_type);
197+
}
196198
}
197199
if (!err)
198200
printk(KERN_NOTICE "capifs: Rev %s\n", rev);

0 commit comments

Comments
 (0)