diff --git a/io_uring/io-wq.c b/io_uring/io-wq.c index 958e619776f0..f752999807ed 100644 --- a/io_uring/io-wq.c +++ b/io_uring/io-wq.c @@ -1034,7 +1034,8 @@ static inline void io_wqe_remove_pending(struct io_wqe *wqe, if (io_wq_is_hashed(work) && work == wqe->hash_tail[hash]) { if (prev) prev_work = container_of(prev, struct io_wq_work, list); - if (prev_work && io_get_work_hash(prev_work) == hash) + if (prev_work && io_wq_is_hashed(prev_work) && + io_get_work_hash(prev_work) == hash) wqe->hash_tail[hash] = prev_work; else wqe->hash_tail[hash] = NULL;