linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cgroup: fix pointer check in css_rstat_init()
@ 2025-04-21 16:51 JP Kobryn
  2025-04-21 18:36 ` Tejun Heo
  0 siblings, 1 reply; 3+ messages in thread
From: JP Kobryn @ 2025-04-21 16:51 UTC (permalink / raw)
  To: tj, shakeel.butt, yosryahmed, mkoutny, hannes, akpm; +Cc: linux-mm, cgroups

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>
---
 kernel/cgroup/rstat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/cgroup/rstat.c b/kernel/cgroup/rstat.c
index 4a8834a70ca6..4d5fd8d12bdd 100644
--- a/kernel/cgroup/rstat.c
+++ b/kernel/cgroup/rstat.c
@@ -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;
 		}
-- 
2.47.1



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-04-21 18:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-21 16:51 [PATCH] cgroup: fix pointer check in css_rstat_init() JP Kobryn
2025-04-21 18:36 ` Tejun Heo
2025-04-21 18:39   ` JP Kobryn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox