linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Disseldorp <ddiss@suse.de>
To: David Howells <dhowells@redhat.com>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] watch_queue: fix IOC_WATCH_QUEUE_SET_SIZE alloc error paths
Date: Mon, 4 Apr 2022 18:13:18 +0200	[thread overview]
Message-ID: <20220404181318.21c0740a@suse.de> (raw)
In-Reply-To: <20220328145746.8146-1-ddiss@suse.de>

Hi David,

Any feedback on this? It's a pretty obvious fix IMO.

On Mon, 28 Mar 2022 16:57:46 +0200, David Disseldorp wrote:

> From code inspection, the watch_queue_set_size() allocation error paths
> return the ret value set via the prior pipe_resize_ring() call, which
> will always be zero.
> 
> Fixes: c73be61cede58 ("pipe: Add general notification queue support")
> Signed-off-by: David Disseldorp <ddiss@suse.de>
> ---
>  kernel/watch_queue.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/kernel/watch_queue.c b/kernel/watch_queue.c
> index 3990e4df3d7b0..a128dedec9db2 100644
> --- a/kernel/watch_queue.c
> +++ b/kernel/watch_queue.c
> @@ -248,6 +248,7 @@ long watch_queue_set_size(struct pipe_inode_info *pipe, unsigned int nr_notes)
>  	if (ret < 0)
>  		goto error;
>  
> +	ret = -ENOMEM;
>  	pages = kcalloc(sizeof(struct page *), nr_pages, GFP_KERNEL);
>  	if (!pages)
>  		goto error;


  reply	other threads:[~2022-04-04 21:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-28 14:57 [PATCH] watch_queue: fix IOC_WATCH_QUEUE_SET_SIZE alloc error paths David Disseldorp
2022-04-04 16:13 ` David Disseldorp [this message]
2022-04-19 14:32   ` David Disseldorp

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 \
    --in-reply-to=20220404181318.21c0740a@suse.de \
    --to=ddiss@suse.de \
    --cc=dhowells@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).