aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/workqueue.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/workqueue.c')
-rw-r--r--kernel/workqueue.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 7e11334a119f..a229a56f3a32 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -3443,8 +3443,6 @@ EXPORT_SYMBOL_GPL(workqueue_congested);
3443 * Test whether @work is currently pending or running. There is no 3443 * Test whether @work is currently pending or running. There is no
3444 * synchronization around this function and the test result is 3444 * synchronization around this function and the test result is
3445 * unreliable and only useful as advisory hints or for debugging. 3445 * unreliable and only useful as advisory hints or for debugging.
3446 * Especially for reentrant wqs, the pending state might hide the
3447 * running state.
3448 * 3446 *
3449 * RETURNS: 3447 * RETURNS:
3450 * OR'd bitmask of WORK_BUSY_* bits. 3448 * OR'd bitmask of WORK_BUSY_* bits.
@@ -3455,17 +3453,15 @@ unsigned int work_busy(struct work_struct *work)
3455 unsigned long flags; 3453 unsigned long flags;
3456 unsigned int ret = 0; 3454 unsigned int ret = 0;
3457 3455
3458 if (!pool)
3459 return 0;
3460
3461 spin_lock_irqsave(&pool->lock, flags);
3462
3463 if (work_pending(work)) 3456 if (work_pending(work))
3464 ret |= WORK_BUSY_PENDING; 3457 ret |= WORK_BUSY_PENDING;
3465 if (find_worker_executing_work(pool, work))
3466 ret |= WORK_BUSY_RUNNING;
3467 3458
3468 spin_unlock_irqrestore(&pool->lock, flags); 3459 if (pool) {
3460 spin_lock_irqsave(&pool->lock, flags);
3461 if (find_worker_executing_work(pool, work))
3462 ret |= WORK_BUSY_RUNNING;
3463 spin_unlock_irqrestore(&pool->lock, flags);
3464 }
3469 3465
3470 return ret; 3466 return ret;
3471} 3467}