diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-02-24 15:56:45 -0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-02-24 15:56:45 -0800 |
| commit | 8301bb240d0f1b1521b83342f3af8edab7131361 (patch) | |
| tree | b866e77863d534d2447f4aaeeba77ea6b307e2bd /kernel/workqueue.c | |
| parent | 12f287878afc39acea00b3e62baf72c79878c427 (diff) | |
| parent | cfbf8d4857c26a8a307fb7cd258074c9dcd8c691 (diff) | |
Merge 3.14-rc4 into tty-next
We want the tty revert here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'kernel/workqueue.c')
| -rw-r--r-- | kernel/workqueue.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 82ef9f3b7473..193e977a10ea 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -1851,6 +1851,12 @@ static void destroy_worker(struct worker *worker) if (worker->flags & WORKER_IDLE) pool->nr_idle--; + /* + * Once WORKER_DIE is set, the kworker may destroy itself at any + * point. Pin to ensure the task stays until we're done with it. + */ + get_task_struct(worker->task); + list_del_init(&worker->entry); worker->flags |= WORKER_DIE; @@ -1859,6 +1865,7 @@ static void destroy_worker(struct worker *worker) spin_unlock_irq(&pool->lock); kthread_stop(worker->task); + put_task_struct(worker->task); kfree(worker); spin_lock_irq(&pool->lock); |
