Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 365539
b: refs/heads/master
c: bc0caf0
h: refs/heads/master
i:
  365537: ee3274e
  365535: 2dea5ca
v: v3
  • Loading branch information
Tejun Heo committed Apr 1, 2013
1 parent d6bb7eb commit 0940a7b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b5927605478b740d73192f587e458de1632106e8
refs/heads/master: bc0caf099d9df4dd0fad24992b043b40541f4200
4 changes: 3 additions & 1 deletion trunk/kernel/workqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand All @@ -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);
}

Expand Down

0 comments on commit 0940a7b

Please sign in to comment.