Skip to content

Commit 2f6a55e

Browse files
Dan Carpenteraxboe
authored andcommitted
io_uring: clean up a type in io_uring_register_get_file()
Originally "fd" was unsigned int but it was changed to int when we pulled this code into a separate function in commit 0b6d253 ("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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 7f44bea commit 2f6a55e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

io_uring/register.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ static int __io_uring_register(struct io_ring_ctx *ctx, unsigned opcode,
561561
* true, then the registered index is used. Otherwise, the normal fd table.
562562
* Caller must call fput() on the returned file, unless it's an ERR_PTR.
563563
*/
564-
struct file *io_uring_register_get_file(int fd, bool registered)
564+
struct file *io_uring_register_get_file(unsigned int fd, bool registered)
565565
{
566566
struct file *file;
567567

io_uring/register.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44

55
int io_eventfd_unregister(struct io_ring_ctx *ctx);
66
int io_unregister_personality(struct io_ring_ctx *ctx, unsigned id);
7-
struct file *io_uring_register_get_file(int fd, bool registered);
7+
struct file *io_uring_register_get_file(unsigned int fd, bool registered);
88

99
#endif

0 commit comments

Comments
 (0)