aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/workqueue.c
diff options
context:
space:
mode:
authorXiaotian Feng <dfeng@redhat.com>2010-08-16 03:54:28 -0400
committerTejun Heo <tj@kernel.org>2010-08-16 03:55:01 -0400
commit8d9df9f0844ed87541453a3ef91bfc9f487053b7 (patch)
treeb9779092c34a47de0cb268f4a631bc1e0024a01a /kernel/workqueue.c
parentda5cabf80e2433131bf0ed8993abc0f7ea618c73 (diff)
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 <dfeng@redhat.com> Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Oleg Nesterov <oleg@redhat.com>
Diffstat (limited to 'kernel/workqueue.c')
-rw-r--r--kernel/workqueue.c2
1 files changed, 1 insertions, 1 deletions
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,
2782 if (IS_ERR(rescuer->task)) 2782 if (IS_ERR(rescuer->task))
2783 goto err; 2783 goto err;
2784 2784
2785 wq->rescuer = rescuer;
2786 rescuer->task->flags |= PF_THREAD_BOUND; 2785 rescuer->task->flags |= PF_THREAD_BOUND;
2787 wake_up_process(rescuer->task); 2786 wake_up_process(rescuer->task);
2788 } 2787 }
@@ -2848,6 +2847,7 @@ void destroy_workqueue(struct workqueue_struct *wq)
2848 if (wq->flags & WQ_RESCUER) { 2847 if (wq->flags & WQ_RESCUER) {
2849 kthread_stop(wq->rescuer->task); 2848 kthread_stop(wq->rescuer->task);
2850 free_mayday_mask(wq->mayday_mask); 2849 free_mayday_mask(wq->mayday_mask);
2850 kfree(wq->rescuer);
2851 } 2851 }
2852 2852
2853 free_cwqs(wq); 2853 free_cwqs(wq);