]> www.infradead.org Git - users/hch/dma-mapping.git/commit
io_uring/io-wq: avoid garbage value of 'match' in io_wq_enqueue()
authorSu Hui <suhui@nfschina.com>
Tue, 4 Jun 2024 12:12:43 +0000 (20:12 +0800)
committerJens Axboe <axboe@kernel.dk>
Tue, 4 Jun 2024 13:39:00 +0000 (07:39 -0600)
commit91215f70ea8541e9011c0b48f8b59b9e0ce6953b
tree3a9075d86f81bb5bcbe07b74f1ca5c8e357a532b
parent415ce0ea55c5a3afea501a773e002be9ed7149f5
io_uring/io-wq: avoid garbage value of 'match' in io_wq_enqueue()

Clang static checker (scan-build) warning:
o_uring/io-wq.c:line 1051, column 3
The expression is an uninitialized value. The computed value will
also be garbage.

'match.nr_pending' is used in io_acct_cancel_pending_work(), but it is
not fully initialized. Change the order of assignment for 'match' to fix
this problem.

Fixes: 42abc95f05bf ("io-wq: decouple work_list protection from the big wqe->lock")
Signed-off-by: Su Hui <suhui@nfschina.com>
Link: https://lore.kernel.org/r/20240604121242.2661244-1-suhui@nfschina.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/io-wq.c