public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] netfs: silence an uninitialized variable warning
@ 2024-11-18  6:08 Dan Carpenter
  2024-11-20  8:28 ` Christian Brauner
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2024-11-18  6:08 UTC (permalink / raw)
  To: David Howells
  Cc: Jeff Layton, netfs, linux-fsdevel, linux-kernel, kernel-janitors

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 <dan.carpenter@linaro.org>
---
 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;
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] netfs: silence an uninitialized variable warning
  2024-11-18  6:08 [PATCH] netfs: silence an uninitialized variable warning Dan Carpenter
@ 2024-11-20  8:28 ` Christian Brauner
  0 siblings, 0 replies; 2+ messages in thread
From: Christian Brauner @ 2024-11-20  8:28 UTC (permalink / raw)
  To: David Howells, Dan Carpenter
  Cc: Christian Brauner, Jeff Layton, netfs, linux-fsdevel,
	linux-kernel, kernel-janitors

On Mon, 18 Nov 2024 09:08:19 +0300, Dan Carpenter wrote:
> 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.
> 
> [...]

Applied to the vfs-6.14.netfs branch of the vfs/vfs.git tree.
Patches in the vfs-6.14.netfs branch should appear in linux-next soon.

Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.

It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.

Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs-6.14.netfs

[1/1] netfs: silence an uninitialized variable warning
      https://git.kernel.org/vfs/vfs/c/574cb560cc1c

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-11-20  8:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-18  6:08 [PATCH] netfs: silence an uninitialized variable warning Dan Carpenter
2024-11-20  8:28 ` Christian Brauner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox