xfs: Initialize error in xfs_attr_remove_iter

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 <allison.henderson@oracle.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Bill O'Donnell <bodonnel@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
This commit is contained in:
Allison Henderson 2021-06-25 11:19:58 -07:00 committed by Darrick J. Wong
parent a8f3522c9a
commit d3a3340b6a
1 changed files with 1 additions and 1 deletions

View File

@ -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);