提交 f7770738 编写于 作者: L Li Zefan 提交者: Linus Torvalds

cgroup: fix memory leak in cgroup_get_sb()

opts.release_agent is not kfree()ed in all necessary places.
Signed-off-by: NLi Zefan <lizf@cn.fujitsu.com>
Acked-by: NPaul Menage <menage@google.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 ffd2d883
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册