Commit 988f032567eaba3c5896c5de05270b9ff71b2a9d
1 parent
5cc361e3b8
Exists in
master
and in
6 other branches
fuse: register_filesystem() called too early
same story as with ubifs Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Showing 1 changed file with 12 additions and 12 deletions Side-by-side Diff
fs/fuse/inode.c
... | ... | @@ -1138,28 +1138,28 @@ |
1138 | 1138 | { |
1139 | 1139 | int err; |
1140 | 1140 | |
1141 | - err = register_filesystem(&fuse_fs_type); | |
1142 | - if (err) | |
1143 | - goto out; | |
1144 | - | |
1145 | - err = register_fuseblk(); | |
1146 | - if (err) | |
1147 | - goto out_unreg; | |
1148 | - | |
1149 | 1141 | fuse_inode_cachep = kmem_cache_create("fuse_inode", |
1150 | 1142 | sizeof(struct fuse_inode), |
1151 | 1143 | 0, SLAB_HWCACHE_ALIGN, |
1152 | 1144 | fuse_inode_init_once); |
1153 | 1145 | err = -ENOMEM; |
1154 | 1146 | if (!fuse_inode_cachep) |
1155 | - goto out_unreg2; | |
1147 | + goto out; | |
1156 | 1148 | |
1149 | + err = register_fuseblk(); | |
1150 | + if (err) | |
1151 | + goto out2; | |
1152 | + | |
1153 | + err = register_filesystem(&fuse_fs_type); | |
1154 | + if (err) | |
1155 | + goto out3; | |
1156 | + | |
1157 | 1157 | return 0; |
1158 | 1158 | |
1159 | - out_unreg2: | |
1159 | + out3: | |
1160 | 1160 | unregister_fuseblk(); |
1161 | - out_unreg: | |
1162 | - unregister_filesystem(&fuse_fs_type); | |
1161 | + out2: | |
1162 | + kmem_cache_destroy(fuse_inode_cachep); | |
1163 | 1163 | out: |
1164 | 1164 | return err; |
1165 | 1165 | } |