]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
io_uring: clean up a type in io_uring_register_get_file()
authorDan Carpenter <dan.carpenter@linaro.org>
Mon, 16 Sep 2024 14:07:10 +0000 (17:07 +0300)
committerJens Axboe <axboe@kernel.dk>
Mon, 16 Sep 2024 18:04:10 +0000 (12:04 -0600)
Originally "fd" was unsigned int but it was changed to int when we pulled
this code into a separate function in commit 0b6d253e084a
("io_uring/register: provide helper to get io_ring_ctx from 'fd'").  This
doesn't really cause a runtime problem because the call to
array_index_nospec() will clamp negative fds to 0 and nothing else uses
the negative values.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/6f6cb630-079f-4fdf-bf95-1082e0a3fc6e@stanley.mountain
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/register.c
io_uring/register.h

index b8a48a6a89ee5252a4b718d0269f57556eaff57c..eca26d4884d9a9c30c1825e73ef3627195226667 100644 (file)
@@ -561,7 +561,7 @@ static int __io_uring_register(struct io_ring_ctx *ctx, unsigned opcode,
  * true, then the registered index is used. Otherwise, the normal fd table.
  * Caller must call fput() on the returned file, unless it's an ERR_PTR.
  */
-struct file *io_uring_register_get_file(int fd, bool registered)
+struct file *io_uring_register_get_file(unsigned int fd, bool registered)
 {
        struct file *file;
 
index cc69b88338fe3f685a0bf78ac0b55296be5b6b3e..a5f39d5ef9e0e4588134c6b50ae4905430f8e1d1 100644 (file)
@@ -4,6 +4,6 @@
 
 int io_eventfd_unregister(struct io_ring_ctx *ctx);
 int io_unregister_personality(struct io_ring_ctx *ctx, unsigned id);
-struct file *io_uring_register_get_file(int fd, bool registered);
+struct file *io_uring_register_get_file(unsigned int fd, bool registered);
 
 #endif