lkml.org 
[lkml]   [2011]   [Jan]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    SubjectRe: [PATCH] sched: fix struct autogroup memory leak
    From
    Date
    On Wed, 2011-01-05 at 11:21 +0100, Peter Zijlstra wrote:
    > On Wed, 2011-01-05 at 11:11 +0100, Mike Galbraith wrote:
    >
    > > static inline void autogroup_free(struct task_group *tg)
    > > {
    > > - kfree(tg->autogroup);
    > > + if (tg->autogroup)
    > > + kfree(tg->autogroup);
    > > }
    >
    > WARNING: kfree(NULL) is safe this check is probably not required
    > #43: FILE: kernel/sched_autogroup.c:24:
    > + if (tg->autogroup)
    > + kfree(tg->autogroup);

    Once upon a time, I knew that.

    sched: fix struct autogroup memory leak

    Add missing change to actually use autogroup_free().

    Signed-off-by: Mike Galbraith <efault@gmx.de>
    Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
    Cc: Ingo Molnar <mingo@elte.hu>

    ---
    kernel/sched.c | 1 +
    1 file changed, 1 insertion(+)

    Index: linux-2.6/kernel/sched.c
    ===================================================================
    --- linux-2.6.orig/kernel/sched.c
    +++ linux-2.6/kernel/sched.c
    @@ -8382,6 +8382,7 @@ static void free_sched_group(struct task
    {
    free_fair_sched_group(tg);
    free_rt_sched_group(tg);
    + autogroup_free(tg);
    kfree(tg);
    }




    \
     
     \ /
      Last update: 2011-01-05 11:33    [W:0.021 / U:59.944 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site