OSDN Git Service

cgroup: fix memory leak in cgroup_mount()
authorLi Zefan <lizefan@huawei.com>
Fri, 14 Feb 2014 08:55:04 +0000 (16:55 +0800)
committerTejun Heo <tj@kernel.org>
Fri, 14 Feb 2014 15:52:40 +0000 (10:52 -0500)
We should free the memory allocated in parse_cgroupfs_options() before
calling this function again.

Signed-off-by: Li Zefan <lizefan@huawei.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/cgroup.c

index 5606c0f..3fe0110 100644 (file)
@@ -1540,6 +1540,8 @@ retry:
                if (!atomic_inc_not_zero(&root->top_cgroup.refcnt)) {
                        mutex_unlock(&cgroup_mutex);
                        mutex_unlock(&cgroup_tree_mutex);
+                       kfree(opts.release_agent);
+                       kfree(opts.name);
                        msleep(10);
                        goto retry;
                }