Skip to contentSkip to conversation

bugreport

PATCH Artem Bityuckiy 1 participant 1 message Jul 26, 2004 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

Hello.

There is a bug in jffs2 module registration function - super.c line 293: the init_jffs2_fs function doesn't properly perform the de-initialization in case of failures on lines 315 and 321.

The jffs2_inode_cachep is also not feed.

The proposed patch is attached.

Note 1: I didn't test this patch and didn't even compile JFFS2 with it - *be careful*.

Note 2: The similar ought to be fixed in super-v24.c

Artem.

Signature · 4 lines
Best regards, Artem B. Bityuckiy
Oktet Labs (St. Petersburg), Software Engineer.
+78124286709 (office) +79112449030 (mobile)
E-mail: [email protected], web: http://www.oktetlabs.ru
home/dedekind/tmp/super_fixed.c renamed from super.c +3 -1
@@ -318,7 +318,7 @@
 	ret = jffs2_compressors_init();
 	if (ret) {
 		printk(KERN_ERR "JFFS2 error: Failed to initialise compressors\n");
-		goto out;
+		goto out_proc;
 	}
 	ret = jffs2_create_slab_caches();
 	if (ret) {
@@ -336,10 +336,12 @@
 	jffs2_destroy_slab_caches();
  out_compressors:
 	jffs2_compressors_exit();
+ out_proc:
 #ifdef CONFIG_JFFS2_PROC
         jffs2_proc_exit();
 #endif
  out:
+        kmem_cache_destroy(jffs2_inode_cachep);
 	return ret;
 }