Re: [PATCH] io_uring: Fix incorrect variable type in io_fixed_fd_install

From: Jens Axboe
Date: Thu May 12 2022 - 08:21:29 EST


On 5/12/22 6:05 AM, Wan Jiabing wrote:
> Fix following coccicheck warning:
> fs/io_uring.c:5352:15-24: WARNING: Unsigned expression compared with zero: file_slot < 0
>
> 'file_slot' is an unsigned variable and it can't be less than 0.
> Use 'ret' instead to check the error code from io_file_bitmap_get().
>
> And using bool to declare 'alloc_slot' makes the code better.

Thanks, I'm going to fold this one in.

--
Jens Axboe