fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / fs / freevxfs / vxfs_super.c
index b74b791..ac28b08 100644 (file)
@@ -260,12 +260,17 @@ static struct file_system_type vxfs_fs_type = {
 static int __init
 vxfs_init(void)
 {
+       int rv;
+
        vxfs_inode_cachep = kmem_cache_create("vxfs_inode",
                        sizeof(struct vxfs_inode_info), 0, 
                        SLAB_RECLAIM_ACCOUNT|SLAB_MEM_SPREAD, NULL, NULL);
-       if (vxfs_inode_cachep)
-               return register_filesystem(&vxfs_fs_type);
-       return -ENOMEM;
+       if (!vxfs_inode_cachep)
+               return -ENOMEM;
+       rv = register_filesystem(&vxfs_fs_type);
+       if (rv < 0)
+               kmem_cache_destroy(vxfs_inode_cachep);
+       return rv;
 }
 
 static void __exit