2014-04-17 02:08:56

by Zefan Li

[permalink] [raw]
Subject: [PATCH] sched/deadline: Fix memory leak

Free cpudl->free_cpus allocated in cpudl_init().

Signed-off-by: Li Zefan <[email protected]>
Cc: <[email protected]> # 3.14
---
kernel/sched/cpudeadline.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/kernel/sched/cpudeadline.c b/kernel/sched/cpudeadline.c
index 5b9bb42..ab001b5 100644
--- a/kernel/sched/cpudeadline.c
+++ b/kernel/sched/cpudeadline.c
@@ -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);
}
--
1.8.0.2


2014-04-17 07:21:43

by Juri Lelli

[permalink] [raw]
Subject: Re: [PATCH] sched/deadline: Fix memory leak

On Thu, 17 Apr 2014 10:05:02 +0800
Li Zefan <[email protected]> wrote:

> Free cpudl->free_cpus allocated in cpudl_init().
>
> Signed-off-by: Li Zefan <[email protected]>
> Cc: <[email protected]> # 3.14
> ---
> kernel/sched/cpudeadline.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/kernel/sched/cpudeadline.c b/kernel/sched/cpudeadline.c
> index 5b9bb42..ab001b5 100644
> --- a/kernel/sched/cpudeadline.c
> +++ b/kernel/sched/cpudeadline.c
> @@ -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