mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-04-16 19:29:06 +08:00
cgroup: fix pointer check in css_rstat_init()
In css_rstat_init() allocations are done for the cgroup's pointers rstat_cpu and rstat_base_cpu. Make sure the allocation checks are consistent with what they are allocating. Signed-off-by: JP Kobryn <inwardvessel@gmail.com> Signed-off-by: Tejun Heo <tj@kernel.org>
This commit is contained in:
@@ -371,7 +371,7 @@ int css_rstat_init(struct cgroup_subsys_state *css)
|
||||
|
||||
if (!cgrp->rstat_base_cpu) {
|
||||
cgrp->rstat_base_cpu = alloc_percpu(struct cgroup_rstat_base_cpu);
|
||||
if (!cgrp->rstat_cpu) {
|
||||
if (!cgrp->rstat_base_cpu) {
|
||||
free_percpu(cgrp->rstat_cpu);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user