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

* Re: [PATCH] cgroup: fix pointer check in css_rstat_init()
  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
  0 siblings, 1 reply; 3+ messages in thread
From: Tejun Heo @ 2025-04-21 18:36 UTC (permalink / raw)
  To: JP Kobryn
  Cc: shakeel.butt, yosryahmed, mkoutny, hannes, akpm, linux-mm, cgroups

On Mon, Apr 21, 2025 at 09:51:17AM -0700, JP Kobryn wrote:
> 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>

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.

-- 
tejun


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

* Re: [PATCH] cgroup: fix pointer check in css_rstat_init()
  2025-04-21 18:36 ` Tejun Heo
@ 2025-04-21 18:39   ` JP Kobryn
  0 siblings, 0 replies; 3+ messages in thread
From: JP Kobryn @ 2025-04-21 18:39 UTC (permalink / raw)
  To: Tejun Heo
  Cc: shakeel.butt, yosryahmed, mkoutny, hannes, akpm, linux-mm, cgroups

On 4/21/25 11:36 AM, Tejun Heo wrote:
> On Mon, Apr 21, 2025 at 09:51:17AM -0700, JP Kobryn wrote:
>> 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>
> 
> 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.


^ 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