Skip to content

Commit 3768f69

Browse files
Darrick J. Wongdchinner
authored andcommitted
xfs: clean up state variable usage in xfs_attr_node_remove_attr
The state variable is now a local variable pointing to a heap allocation, so we don't need to zero-initialize it, nor do we need the conditional to decide if we should free it. Signed-off-by: Darrick J. Wong <[email protected]> Reviewed-by: Dave Chinner <[email protected]> Reviewed-by: Allison Henderson <[email protected]> Signed-off-by: Dave Chinner <[email protected]>
1 parent 4136e38 commit 3768f69

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

fs/xfs/libxfs/xfs_attr.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1516,7 +1516,7 @@ xfs_attr_node_remove_attr(
15161516
struct xfs_attr_item *attr)
15171517
{
15181518
struct xfs_da_args *args = attr->xattri_da_args;
1519-
struct xfs_da_state *state = NULL;
1519+
struct xfs_da_state *state = xfs_da_state_alloc(args);
15201520
int retval = 0;
15211521
int error = 0;
15221522

@@ -1526,8 +1526,6 @@ xfs_attr_node_remove_attr(
15261526
* attribute entry after any split ops.
15271527
*/
15281528
args->attr_filter |= XFS_ATTR_INCOMPLETE;
1529-
state = xfs_da_state_alloc(args);
1530-
state->inleaf = 0;
15311529
error = xfs_da3_node_lookup_int(state, &retval);
15321530
if (error)
15331531
goto out;
@@ -1545,8 +1543,7 @@ xfs_attr_node_remove_attr(
15451543
retval = error = 0;
15461544

15471545
out:
1548-
if (state)
1549-
xfs_da_state_free(state);
1546+
xfs_da_state_free(state);
15501547
if (error)
15511548
return error;
15521549
return retval;

0 commit comments

Comments
 (0)