diff options
author | Li Zefan <lizf@cn.fujitsu.com> | 2008-02-23 23:24:10 (GMT) |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-24 01:13:24 (GMT) |
commit | f777073848ba3708d68d87e43f104f83316187d7 (patch) | |
tree | 4eb0e5e36e70165c4eb7d41673bacd70423a986d | |
parent | ffd2d883399cbbb641e55730676ce1ec4845d99d (diff) | |
download | linux-fsl-qoriq-f777073848ba3708d68d87e43f104f83316187d7.tar.xz |
cgroup: fix memory leak in cgroup_get_sb()
opts.release_agent is not kfree()ed in all necessary places.
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: Paul Menage <menage@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | kernel/cgroup.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 36066d8..947fe3b 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c @@ -954,8 +954,11 @@ static int cgroup_get_sb(struct file_system_type *fs_type, } root = kzalloc(sizeof(*root), GFP_KERNEL); - if (!root) + if (!root) { + if (opts.release_agent) + kfree(opts.release_agent); return -ENOMEM; + } init_cgroup_root(root); root->subsys_bits = opts.subsys_bits; |