diff options
| author | 2014-03-19 13:02:34 +0000 | |
|---|---|---|
| committer | 2014-03-19 13:02:34 +0000 | |
| commit | 236b11de51c7501c454ca125d84152b06ef7f27e (patch) | |
| tree | d0ca0b99961da2a8a46b4f86a57de8424dadce1d /kernel/workqueue.c | |
| parent | regulator: s2mps11: Fix section mismatch (diff) | |
| parent | Documentation: mfd: Add binding document for S2MPA01 (diff) | |
Merge branch 'ib-mfd-regulator-3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd into regulator-s2mps11
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); |
