Skip to content

Commit

Permalink
sched: fix memory leak in a failure path
Browse files Browse the repository at this point in the history
Impact: fix rare memory leak in the sched-domains manual reconfiguration code

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

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Li Zefan authored and Ingo Molnar committed Nov 7, 2008
1 parent f29c9b1 commit ca3273f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -7676,6 +7676,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
}
Expand Down

0 comments on commit ca3273f

Please sign in to comment.