From 0940a7b452033d2341234f1a76afb6afd1e0abf3 Mon Sep 17 00:00:00 2001 From: Tejun Heo Date: Mon, 1 Apr 2013 11:23:31 -0700 Subject: [PATCH] --- yaml --- r: 365539 b: refs/heads/master c: bc0caf099d9df4dd0fad24992b043b40541f4200 h: refs/heads/master i: 365537: ee3274edac6f1f443e06e2b9c8d047fb2d715efe 365535: 2dea5cae251f64d68ee8afdd4e1e742b7781353f v: v3 --- [refs] | 2 +- trunk/kernel/workqueue.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 6ec5ec6e1e28..73a0e291ac1b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: b5927605478b740d73192f587e458de1632106e8 +refs/heads/master: bc0caf099d9df4dd0fad24992b043b40541f4200 diff --git a/trunk/kernel/workqueue.c b/trunk/kernel/workqueue.c index 04a8b98d30ce..4d344326ae97 100644 --- a/trunk/kernel/workqueue.c +++ b/trunk/kernel/workqueue.c @@ -3534,6 +3534,7 @@ static void pwq_unbound_release_workfn(struct work_struct *work) unbound_release_work); struct workqueue_struct *wq = pwq->wq; struct worker_pool *pool = pwq->pool; + bool is_last; if (WARN_ON_ONCE(!(wq->flags & WQ_UNBOUND))) return; @@ -3545,6 +3546,7 @@ static void pwq_unbound_release_workfn(struct work_struct *work) */ mutex_lock(&wq->mutex); list_del_rcu(&pwq->pwqs_node); + is_last = list_empty(&wq->pwqs); mutex_unlock(&wq->mutex); put_unbound_pool(pool); @@ -3554,7 +3556,7 @@ static void pwq_unbound_release_workfn(struct work_struct *work) * If we're the last pwq going away, @wq is already dead and no one * is gonna access it anymore. Free it. */ - if (list_empty(&wq->pwqs)) + if (is_last) kfree(wq); }