All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Disseldorp <ddiss@suse.de>
To: David Howells <dhowells@redhat.com>, linux-fsdevel@vger.kernel.org
Cc: David Disseldorp <ddiss@suse.de>
Subject: [PATCH RESEND] watch_queue: fix IOC_WATCH_QUEUE_SET_SIZE alloc error paths
Date: Sat, 21 May 2022 00:37:58 +0200	[thread overview]
Message-ID: <20220520223758.32548-1-ddiss@suse.de> (raw)

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 230038d4f908..a89a65954ce1 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;
-- 
2.35.3


                 reply	other threads:[~2022-05-20 22:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20220520223758.32548-1-ddiss@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.