In the else arm, sel->val is necessarily 0 so the min_not_zero() actually always returns kmsg->msg.msg_inq. Remove the min_not_zero() usage and replace it with kmsg->msg.msg_inq. Signed-off-by: Clément Léger --- io_uring/net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/io_uring/net.c b/io_uring/net.c index f5f4f3ce6ef3..efc8ea5010ad 100644 --- a/io_uring/net.c +++ b/io_uring/net.c @@ -1146,7 +1146,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, (ssize_t) kmsg->msg.msg_inq); + arg.max_len = kmsg->msg.msg_inq; /* if mshot limited, ensure we don't go over */ if (sr->flags & IORING_RECV_MSHOT_LIM) -- 2.53.0-Meta