2024-03-01 14:43:45

by Muhammad Usama Anjum

[permalink] [raw]
Subject: [PATCH io_uring/net: correct the type of variable

The namelen is of type int. It shouldn't be made size_t which is
unsigned. The signed number is needed for error checking before use.

Fixes: c55978024d12 ("io_uring/net: move receive multishot out of the generic msghdr path")
Signed-off-by: Muhammad Usama Anjum <[email protected]>
---
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 926d1fb0335de..b4ca803d85e23 100644
--- a/io_uring/net.c
+++ b/io_uring/net.c
@@ -551,7 +551,7 @@ int io_send(struct io_kiocb *req, unsigned int issue_flags)

static int io_recvmsg_mshot_prep(struct io_kiocb *req,
struct io_async_msghdr *iomsg,
- size_t namelen, size_t controllen)
+ int namelen, size_t controllen)
{
if ((req->flags & (REQ_F_APOLL_MULTISHOT|REQ_F_BUFFER_SELECT)) ==
(REQ_F_APOLL_MULTISHOT|REQ_F_BUFFER_SELECT)) {
--
2.39.2



2024-03-01 16:02:28

by Jens Axboe

[permalink] [raw]
Subject: Re: [PATCH io_uring/net: correct the type of variable


On Fri, 01 Mar 2024 19:43:48 +0500, Muhammad Usama Anjum wrote:
> The namelen is of type int. It shouldn't be made size_t which is
> unsigned. The signed number is needed for error checking before use.
>
>

Applied, thanks!

[1/1] [PATCH io_uring/net: correct the type of variable
commit: e86b4a164fc86d224bd177e02a9c070b9f1c3db4

Best regards,
--
Jens Axboe