]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
io_uring/net: correct type for min_not_zero() cast
authorJens Axboe <axboe@kernel.dk>
Tue, 2 Sep 2025 11:19:42 +0000 (05:19 -0600)
committerJens Axboe <axboe@kernel.dk>
Tue, 2 Sep 2025 11:19:42 +0000 (05:19 -0600)
The kernel test robot reports that after a recent change, the signedness
of a min_not_zero() compare is now incorrect. Fix that up and cast to
the right type.

Fixes: 429884ff35f7 ("io_uring/kbuf: use struct io_br_sel for multiple buffers picking")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202509020426.WJtrdwOU-lkp@intel.com/
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/net.c

index d2ca49ceb79d6e591f9bba0cafc21fc95ea6af9d..226fea2312b5877f42bfa7dd965c4b76bd61b46d 100644 (file)
@@ -1118,7 +1118,7 @@ static int io_recv_buf_select(struct io_kiocb *req, struct io_async_msghdr *kmsg
                if (sel->val)
                        arg.max_len = sel->val;
                else if (kmsg->msg.msg_inq > 1)
-                       arg.max_len = min_not_zero(sel->val, (size_t) kmsg->msg.msg_inq);
+                       arg.max_len = min_not_zero(sel->val, (ssize_t) kmsg->msg.msg_inq);
 
                /* if mshot limited, ensure we don't go over */
                if (sr->flags & IORING_RECV_MSHOT_LIM)