* [PATCH][next] netfs: fix uninitilalized value in ret being returned
@ 2022-03-03 23:56 Colin Ian King
0 siblings, 0 replies; only message in thread
From: Colin Ian King @ 2022-03-03 23:56 UTC (permalink / raw)
To: David Howells, Jeff Layton; +Cc: kernel-janitors, linux-kernel
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-03-03 23:56 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-03 23:56 [PATCH][next] netfs: fix uninitilalized value in ret being returned Colin Ian King
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®