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:
1810673
)
ceph: fix potential memory leak in init_caches()
author
Chengguang Xu
<
[email protected]
>
Thu, 1 Mar 2018 06:24:51 +0000
(14:24 +0800)
committer
Ilya Dryomov
<
[email protected]
>
Thu, 1 Mar 2018 15:39:47 +0000
(16:39 +0100)
There is lack of cache destroy operation for ceph_file_cachep
when failing from fscache register.
Signed-off-by: Chengguang Xu <
[email protected]
>
Reviewed-by: Ilya Dryomov <
[email protected]
>
Signed-off-by: Ilya Dryomov <
[email protected]
>
fs/ceph/super.c
patch
|
blob
|
history
diff --git
a/fs/ceph/super.c
b/fs/ceph/super.c
index 1c470b453a9e9d9d89de5541a460032741e02750..fb2bc9c15a2378ceb5712269ab93e677c360f5d0 100644
(file)
--- a/
fs/ceph/super.c
+++ b/
fs/ceph/super.c
@@
-713,14
+713,17
@@
static int __init init_caches(void)
goto bad_dentry;
ceph_file_cachep = KMEM_CACHE(ceph_file_info, SLAB_MEM_SPREAD);
-
if (!ceph_file_cachep)
goto bad_file;
- if ((error = ceph_fscache_register()))
- goto bad_file;
+ error = ceph_fscache_register();
+ if (error)
+ goto bad_fscache;
return 0;
+
+bad_fscache:
+ kmem_cache_destroy(ceph_file_cachep);
bad_file:
kmem_cache_destroy(ceph_dentry_cachep);
bad_dentry: