Thread (90 messages) 90 messages, 6 authors, 2021-11-04
STALE1717d REVIEWED: 3 (1M)

[PATCH 55/61] xfs: Initialize error in xfs_attr_remove_iter

From: "Darrick J. Wong" <djwong@kernel.org>
Date: 2021-09-15 23:11:36
Subsystem: the rest · Maintainer: Linus Torvalds

From: Allison Henderson <redacted>

Source kernel commit: d3a3340b6af28ab79a66687973fb0287d976d490

A recent bug report generated a warning that a code path in
xfs_attr_remove_iter could potentially return error uninitialized in the
case of XFS_DAS_RM_SHRINK state.  Fix this by initializing error.

Signed-off-by: Allison Henderson <redacted>
Reported-by: Dan Carpenter <redacted>
Reviewed-by: Brian Foster <redacted>
Reviewed-by: Bill O'Donnell <redacted>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 libxfs/xfs_attr.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libxfs/xfs_attr.c b/libxfs/xfs_attr.c
index 8f6f1754..d6195789 100644
--- a/libxfs/xfs_attr.c
+++ b/libxfs/xfs_attr.c
@@ -1375,7 +1375,7 @@ xfs_attr_remove_iter(
 {
 	struct xfs_da_args		*args = dac->da_args;
 	struct xfs_da_state		*state = dac->da_state;
-	int				retval, error;
+	int				retval, error = 0;
 	struct xfs_inode		*dp = args->dp;
 
 	trace_xfs_attr_node_removename(args);
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help