public inbox for [email protected]
 help / color / mirror / Atom feed
From: Pavel Begunkov <[email protected]>
To: Dan Carpenter <[email protected]>, Jens Axboe <[email protected]>
Cc: Alexander Viro <[email protected]>,
	[email protected], [email protected],
	[email protected]
Subject: Re: [PATCH] io_uring: fix an IS_ERR() vs NULL check
Date: Wed, 6 Jan 2021 12:32:45 +0000	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <X/WCTxIRT4SHLemV@mwanda>

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 <[email protected]>

thanks Dan,

Reviewed-by: Pavel Begunkov <[email protected]>
Cc: [email protected] # 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

  reply	other threads:[~2021-01-06 12:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-06  9:26 [PATCH] io_uring: fix an IS_ERR() vs NULL check Dan Carpenter
2021-01-06 12:32 ` Pavel Begunkov [this message]
2021-01-06 14:34   ` Matthew Wilcox
2021-01-06 14:56     ` Dan Carpenter
2021-01-06 14:59       ` Jens Axboe
2021-01-06 14:29 ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox