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>

authored by Li Zefan and committed by Linus Torvalds f7770738 ffd2d883

+4 -1
+4 -1
kernel/cgroup.c
··· 954 954 } 955 955 956 956 root = kzalloc(sizeof(*root), GFP_KERNEL); 957 - if (!root) 957 + if (!root) { 958 + if (opts.release_agent) 959 + kfree(opts.release_agent); 958 960 return -ENOMEM; 961 + } 959 962 960 963 init_cgroup_root(root); 961 964 root->subsys_bits = opts.subsys_bits;