Re: [PATCH] io_uring: fix an IS_ERR() vs NULL check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 06/01/2021 09:26, Dan Carpenter wrote:
> The alloc_fixed_file_ref_node() function never returns NULL, it returns
> error pointers on error.
> 
> Fixes: 1ffc54220c44 ("io_uring: fix io_sqe_files_unregister() hangs")
> Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>

thanks Dan,

Reviewed-by: Pavel Begunkov <asml.silence@xxxxxxxxx>
Cc: stable@xxxxxxxxxxxxxxx # 5.6+

> ---
>  fs/io_uring.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/io_uring.c b/fs/io_uring.c
> index ca46f314640b..2234ce03034a 100644
> --- a/fs/io_uring.c
> +++ b/fs/io_uring.c
> @@ -7255,8 +7255,8 @@ static int io_sqe_files_unregister(struct io_ring_ctx *ctx)
>  	if (!data)
>  		return -ENXIO;
>  	backup_node = alloc_fixed_file_ref_node(ctx);
> -	if (!backup_node)
> -		return -ENOMEM;
> +	if (IS_ERR(backup_node))
> +		return PTR_ERR(backup_node);
>  
>  	spin_lock_bh(&data->lock);
>  	ref_node = data->node;
> 

-- 
Pavel Begunkov



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux