Skip to contentSkip to conversation

sched: fix memory leak in a failing path

PATCH Applied Li Zefan 2 participants 2 messages Nov 7, 2008

lore
Share & tools
lore

Li Zefan

author
#0 lore raw

PATCH 1/1 sched: fix memory leak in a failing path

In the failing path, rd is not attached to a sched domain, so it causes a leak.

---
 kernel/sched.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
kernel/sched.c +1 -0
index e8819bc..24a70d5 100644
@@ -7672,6 +7672,7 @@ static int __build_sched_domains(const cpumask_t *cpu_map,
 error:
 	free_sched_groups(cpu_map, tmpmask);
 	SCHED_CPUMASK_FREE((void *)allmasks);
+	kfree(rd);
 	return -ENOMEM;
 #endif
 }
Signature · 1 line
1.5.4.rc3
Applied
#1 lore raw
Quoted 7 lines · Li Zefan

In the failing path, rd is not attached to a sched domain, so it causes a leak.

---
 kernel/sched.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

applied to tip/sched/urgent, thanks!

Ingo