projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
50d44ed
)
[PATCH] freevxfs: fix leak on error path
author
Alexey Dobriyan
<
[email protected]
>
Fri, 29 Sep 2006 09:01:04 +0000
(
02:01
-0700)
committer
Linus Torvalds
<
[email protected]
>
Fri, 29 Sep 2006 16:18:20 +0000
(09:18 -0700)
If register_filesystem() fails, vxfs_inode cache must be destroyed.
Signed-off-by: Alexey Dobriyan <
[email protected]
>
Acked-by: Christoph Hellwig <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
fs/freevxfs/vxfs_super.c
patch
|
blob
|
history
diff --git
a/fs/freevxfs/vxfs_super.c
b/fs/freevxfs/vxfs_super.c
index b74b791fc23ba6e4b905e2312518ddde0073ba16..ac28b0835ffc611a0236f3ba745744ba1ca05390 100644
(file)
--- a/
fs/freevxfs/vxfs_super.c
+++ b/
fs/freevxfs/vxfs_super.c
@@
-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