From: Tejun Heo Date: Mon, 1 Apr 2013 18:23:31 +0000 (-0700) Subject: workqueue: fix race condition in unbound workqueue free path X-Git-Tag: omap-for-v3.10/dt-fixes-for-merge-window~125^2~19 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bc0caf099d9df4dd0fad24992b043b40541f4200;p=pandora-kernel.git workqueue: fix race condition in unbound workqueue free path 8864b4e59 ("workqueue: implement get/put_pwq()") implemented pwq (pool_workqueue) refcnting which frees workqueue when the last pwq goes away. It determined whether it was the last pwq by testing wq->pwqs is empty. Unfortunately, the test was done outside wq->mutex and multiple pwq release could race and try to free wq multiple times leading to oops. Test wq->pwqs emptiness while holding wq->mutex. Signed-off-by: Tejun Heo --- Reading git-diff-tree failed