Commit 2e3c18d0 authored by Tetsuo Handa's avatar Tetsuo Handa Committed by Jens Axboe

block: pass no-op callback to INIT_WORK().

syzbot is hitting flush_work() warning caused by commit 4d43d395
("workqueue: Try to catch flush_work() without INIT_WORK().") [1].
Although that commit did not expect INIT_WORK(NULL) case, calling
flush_work() without setting a valid callback should be avoided anyway.
Fix this problem by setting a no-op callback instead of NULL.

[1] default avatarTetsuo Handa <>
Reported-and-tested-by: default avatarsyzbot <>
Cc: Tejun Heo <>
Signed-off-by: default avatarJens Axboe <>
parent 3ca17a24
......@@ -462,6 +462,10 @@ static void blk_rq_timed_out_timer(struct timer_list *t)
static void blk_timeout_work(struct work_struct *work)
* blk_alloc_queue_node - allocate a request queue
* @gfp_mask: memory allocation flags
......@@ -505,7 +509,7 @@ struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id)
laptop_mode_timer_fn, 0);
timer_setup(&q->timeout, blk_rq_timed_out_timer, 0);
INIT_WORK(&q->timeout_work, NULL);
INIT_WORK(&q->timeout_work, blk_timeout_work);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment