Skip to contentSkip to conversation

sched/deadline: Fix memory leak

PATCH In review Li Zefan 3 participants 3 messages Apr 17, 2014 – May 8, 2014 Scheduler

lore
Share & tools
lore

Li Zefan

author
#0 lore raw

PATCH 1/1 sched/deadline: Fix memory leak

Free cpudl->free_cpus allocated in cpudl_init().

---
 kernel/sched/cpudeadline.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
kernel/sched/cpudeadline.c +1 -3
index 5b9bb42..ab001b5 100644
@@ -210,7 +210,5 @@ int cpudl_init(struct cpudl *cp)
  */
 void cpudl_cleanup(struct cpudl *cp)
 {
-	/*
-	 * nothing to do for the moment
-	 */
+	free_cpumask_var(cp->free_cpus);
 }
Signature · 1 line
1.8.0.2
#1 lore raw
Quoted 13 lines · On Thu, 17 Apr 2014 10:05:02 +0800 Li Zefan <[email protected]> wrote:

Free cpudl->free_cpus allocated in cpudl_init().

---
 kernel/sched/cpudeadline.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
kernel/sched/cpudeadline.c +0 -0
index 5b9bb42..ab001b5 100644

kernel/sched/cpudeadline.c int cpudl_init(struct cpudl *cp) · line 214

Quoted 8 lines
kernel/sched/cpudeadline.c +1 -3
@@ -210,7 +210,5 @@ int cpudl_init(struct cpudl *cp)
  */
 void cpudl_cleanup(struct cpudl *cp)
 {
-	/*
-	 * nothing to do for the moment
-	 */
+	free_cpumask_var(cp->free_cpus);
 }

Thanks!

- Juri

#2 lore raw
In reply to Li Zefan
sched/deadline: Fix memory leak
Commit-ID:  6a7cd273dc4bc3246f37ebe874754a54ccb29141
Gitweb:     http://git.kernel.org/tip/6a7cd273dc4bc3246f37ebe874754a54ccb29141
Author:     Li Zefan <[email protected]>
AuthorDate: Thu, 17 Apr 2014 10:05:02 +0800
Committer:  Ingo Molnar <[email protected]>
CommitDate: Wed, 7 May 2014 11:51:32 +0200

sched/deadline: Fix memory leak

Free cpudl->free_cpus allocated in cpudl_init().

---
 kernel/sched/cpudeadline.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
kernel/sched/cpudeadline.c +1 -3
index 5b9bb42..ab001b5 100644
@@ -210,7 +210,5 @@ int cpudl_init(struct cpudl *cp)
  */
 void cpudl_cleanup(struct cpudl *cp)
 {
-	/*
-	 * nothing to do for the moment
-	 */
+	free_cpumask_var(cp->free_cpus);
 }