From: Xiaotian Feng Date: Mon, 16 Aug 2010 07:54:28 +0000 (+0200) Subject: workqueue: free rescuer on destroy_workqueue X-Git-Tag: MMI-PSA29.97-13-9~22398^2~7 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8d9df9f0844ed87541453a3ef91bfc9f487053b7;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git workqueue: free rescuer on destroy_workqueue 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 Signed-off-by: Tejun Heo Cc: Oleg Nesterov --- diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 2994a0e3a61c..1001b6e3fcbd 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);