From 1b90b90f3fad8166ecc3e53c1a7af563cbe92659 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Mon, 18 Nov 2024 09:08:19 +0300 Subject: [PATCH] netfs: silence an uninitialized variable warning Smatch complains that "ret" is uninitialized on the success path if we don't enter the nested loop at the end of the function. In real life we will enter that loop so "ret" will be zero. Generally, I don't endorse silencing static checker warnings but in this case, I think it make sense. Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/867904ba-85fe-4766-91cb-3c8ce0703c1e@stanley.mountain Signed-off-by: Christian Brauner --- fs/netfs/write_issue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/netfs/write_issue.c b/fs/netfs/write_issue.c index cd2b349243b3..8f02d8effe78 100644 --- a/fs/netfs/write_issue.c +++ b/fs/netfs/write_issue.c @@ -862,7 +862,7 @@ int netfs_writeback_single(struct address_space *mapping, struct netfs_inode *ictx = netfs_inode(mapping->host); struct folio_queue *fq; size_t size = iov_iter_count(iter); - int ret; + int ret = 0; if (WARN_ON_ONCE(!iov_iter_is_folioq(iter))) return -EIO;