lkml.org 
[lkml]   [2010]   [Aug]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH] workqueue: free rescuer on destroy_workqueue
    Date
    wq->rescuer is not freed when wq is destroyed, leads a memory leak
    then. This patch also remove a redundant line.

    Signed-off-by: Xiaotian Feng <dfeng@redhat.com>
    Cc: Tejun Heo <tj@kernel.org>
    Cc: Oleg Nesterov <oleg@redhat.com>
    ---
    kernel/workqueue.c | 2 +-
    1 files changed, 1 insertions(+), 1 deletions(-)

    diff --git a/kernel/workqueue.c b/kernel/workqueue.c
    index 2994a0e..1001b6e 100644
    --- a/kernel/workqueue.c
    +++ b/kernel/workqueue.c
    @@ -2782,7 +2782,6 @@ struct workqueue_struct *__alloc_workqueue_key(const char *name,
    if (IS_ERR(rescuer->task))
    goto err;

    - wq->rescuer = rescuer;
    rescuer->task->flags |= PF_THREAD_BOUND;
    wake_up_process(rescuer->task);
    }
    @@ -2848,6 +2847,7 @@ void destroy_workqueue(struct workqueue_struct *wq)
    if (wq->flags & WQ_RESCUER) {
    kthread_stop(wq->rescuer->task);
    free_mayday_mask(wq->mayday_mask);
    + kfree(wq->rescuer);
    }

    free_cwqs(wq);
    --
    1.7.2.1


    \
     
     \ /
      Last update: 2010-08-13 12:25    [W:0.018 / U:29.600 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site