cgroup: fix pointer check in css_rstat_init()
Subsystems (2)
PATCH 1/1 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.
--- kernel/cgroup/rstat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/cgroup/rstat.c +1 -1
@@ -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 ; }
Signature · 1 line
2.47.1
Quoted 5 lines · JP Kobryn
In
css_rstat_init()allocations are done for the cgroup's pointersrstat_cpuandrstat_base_cpu. Make sure the allocation checks are consistent with what they are allocating.Signed-off-by JP Kobryn <[email protected]>
Applied to cgroup/for-6.16. BTW, it could be nicer if you note the commit that's being fixed or at least the target branch (here, cgroup/for-6.16).
Thanks.
Signature · 1 line
tejun
Quoted 5 lines · Tejun Heo
Quoted 4 lines · JP Kobryn
In
css_rstat_init()allocations are done for the cgroup's pointersrstat_cpuandrstat_base_cpu. Make sure the allocation checks are consistent with what they are allocating.
Quoted 7 lines
Quoted 1 line
Signed-off-by JP Kobryn <[email protected]>Applied to cgroup/for-6.16. BTW, it could be nicer if you note the commit that's being fixed or at least the target branch (here, cgroup/for-6.16).
Thanks.
Thanks, will keep in mind moving forward.