From: James Morris Date: Sat, 27 Aug 2005 11:47:06 +0000 (+0200) Subject: [PATCH] Fix capifs bug in initialization error path. X-Git-Tag: v2.6.13~8 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=820d220de400cfaaf846a2d8b5de93f9ea5a9b80;p=linux-2.6 [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 Signed-off-by: Karsten Keil Signed-off-by: Linus Torvalds --- diff --git a/drivers/isdn/capi/capifs.c b/drivers/isdn/capi/capifs.c index f8570fd9d2..3abd7fc6e5 100644 --- a/drivers/isdn/capi/capifs.c +++ b/drivers/isdn/capi/capifs.c @@ -191,8 +191,10 @@ static int __init capifs_init(void) err = register_filesystem(&capifs_fs_type); if (!err) { capifs_mnt = kern_mount(&capifs_fs_type); - if (IS_ERR(capifs_mnt)) + if (IS_ERR(capifs_mnt)) { err = PTR_ERR(capifs_mnt); + unregister_filesystem(&capifs_fs_type); + } } if (!err) printk(KERN_NOTICE "capifs: Rev %s\n", rev);