Skip to contentSkip to conversation

Fix capifs bug in initialization error path.

PATCH In review James Morris 3 participants 3 messages Aug 27, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix capifs bug in initialization error path.

This patch fixes a bug in the capifs initialization code, where the filesystem is not unregistered if kern_mount() fails.

Please apply.

---

 capifs.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletion(-)
drivers/isdn/capi/capifs.c +3 -1
diff -purN -X dontdiff linux-2.6.13-mm2.o/drivers/isdn/capi/capifs.c linux-2.6.13-mm2.x/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);
#1 lore raw
Quoted 4 lines · James Morris

This patch fixes a bug in the capifs initialization code, where the filesystem is not unregistered if kern_mount() fails.

Please apply.

looks OK for me.

---

 capifs.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletion(-)
drivers/isdn/capi/capifs.c +3 -1
diff -purN -X dontdiff linux-2.6.13-mm2.o/drivers/isdn/capi/capifs.c linux-2.6.13-mm2.x/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);
Signature · 3 lines
Karsten Keil
SuSE Labs
ISDN development
#2 lore raw

Hi Karsten,

Quoted 6 lines
Quoted 4 lines

This patch fixes a bug in the capifs initialization code, where the filesystem is not unregistered if kern_mount() fails.

Please apply.

looks OK for me.

and what about me idea to remove capifs completely? We have udev now and thus it is not needed anymore. I stopped compiling and using it a long time ago.

Regards

Marcel