From: Colin Ian King <colin.i.king@gmail.com>
To: David Howells <dhowells@redhat.com>, Jeff Layton <jlayton@kernel.org>
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH][next] netfs: fix uninitilalized value in ret being returned
Date: Thu, 3 Mar 2022 23:56:47 +0000 [thread overview]
Message-ID: <20220303235647.1297171-1-colin.i.king@gmail.com> (raw)
In the case where sync is not true the variable ret not being
set and a garbage value is being returned. Fix this by ensuring
ret is initialized to 0.
Fixes: c19a5d31b470 ("netfs: Add a function to consolidate beginning a read")
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
fs/netfs/io.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/netfs/io.c b/fs/netfs/io.c
index 3db9356eb7c2..05fbe6665508 100644
--- a/fs/netfs/io.c
+++ b/fs/netfs/io.c
@@ -601,7 +601,7 @@ static bool netfs_rreq_submit_slice(struct netfs_io_request *rreq,
int netfs_begin_read(struct netfs_io_request *rreq, bool sync)
{
unsigned int debug_index = 0;
- int ret;
+ int ret = 0;
_enter("R=%x %llx-%llx",
rreq->debug_id, rreq->start, rreq->start + rreq->len - 1);
--
2.34.1
reply other threads:[~2022-03-03 23:56 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=20220303235647.1297171-1-colin.i.king@gmail.com \
--to=colin.i.king@gmail.com \
--cc=dhowells@redhat.com \
--cc=jlayton@kernel.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®