diff options
author | Xiaotian Feng <dfeng@redhat.com> | 2010-08-16 09:54:28 +0200 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2010-08-16 09:55:01 +0200 |
commit | 8d9df9f0844ed87541453a3ef91bfc9f487053b7 (patch) | |
tree | b9779092c34a47de0cb268f4a631bc1e0024a01a /kernel/workqueue.c | |
parent | Linux 2.6.36-rc1 (diff) | |
download | linux-8d9df9f0844ed87541453a3ef91bfc9f487053b7.tar.xz linux-8d9df9f0844ed87541453a3ef91bfc9f487053b7.zip |
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.c | 2 |
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, 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); |