[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20251208024043.2887311-1-liwanwu9113@163.com>
Date: Mon, 8 Dec 2025 10:40:43 +0800
From: Wanwu Li <liwanwu9113@....com>
To: mingo@...hat.com,
peterz@...radead.org,
juri.lelli@...hat.com,
vincent.guittot@...aro.org
Cc: dietmar.eggemann@....com,
rostedt@...dmis.org,
bsegall@...gle.com,
mgorman@...e.de,
vschneid@...hat.com,
linux-kernel@...r.kernel.org,
Wanwu Li <liwanwu@...inos.cn>
Subject: [PATCH] sched/fair: Remove redundant error handling path in alloc_fair_sched_group
From: Wanwu Li <liwanwu@...inos.cn>
On error, the sched_free_group function already centrally handles
resource cleanup, making the explicit kfree(cfs_rq) in
alloc_fair_sched_group redundant.
Signed-off-by: Wanwu Li <liwanwu@...inos.cn>
---
kernel/sched/fair.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index da46c3164537..b657d3281f44 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -13645,7 +13645,7 @@ int alloc_fair_sched_group(struct task_group *tg, struct task_group *parent)
se = kzalloc_node(sizeof(struct sched_entity_stats),
GFP_KERNEL, cpu_to_node(i));
if (!se)
- goto err_free_rq;
+ goto err;
init_cfs_rq(cfs_rq);
init_tg_cfs_entry(tg, cfs_rq, se, i, parent->se[i]);
@@ -13654,8 +13654,6 @@ int alloc_fair_sched_group(struct task_group *tg, struct task_group *parent)
return 1;
-err_free_rq:
- kfree(cfs_rq);
err:
return 0;
}
--
2.25.1
Powered by blists - more mailing lists