diff --git a/fs/io-wq.c b/fs/io-wq.c index 5b45c936fcc56479c84dfb64b1b90e099a9d75b6..4f9ce90355e9b7a530228304cf11c250c2b00057 100644 --- a/fs/io-wq.c +++ b/fs/io-wq.c @@ -459,10 +459,12 @@ static void io_impersonate_work(struct io_worker *worker, static void io_assign_current_work(struct io_worker *worker, struct io_wq_work *work) { - /* flush pending signals before assigning new work */ - if (signal_pending(current)) - flush_signals(current); - cond_resched(); + if (work) { + /* flush pending signals before assigning new work */ + if (signal_pending(current)) + flush_signals(current); + cond_resched(); + } spin_lock_irq(&worker->lock); worker->cur_work = work;