From: Allison Henderson Date: Fri, 15 Oct 2021 20:28:27 +0000 (-0400) Subject: xfs: Initialize error in xfs_attr_remove_iter X-Git-Tag: libxfs-5.14-sync_2021-10-16~6 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=13f632a6f6a0ee9a327d4c06b5af50bdb19ec59e;p=thirdparty%2Fxfsprogs-dev.git xfs: Initialize error in xfs_attr_remove_iter 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 Reported-by: Dan Carpenter Reviewed-by: Brian Foster Reviewed-by: Bill O'Donnell Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong Signed-off-by: Eric Sandeen --- diff --git a/libxfs/xfs_attr.c b/libxfs/xfs_attr.c index 8f6f1754e..d61957890 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);