mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-29 15:42:46 +00:00
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 <djwong@kernel.org> Reviewed-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Allison Henderson <allison.henderson@oracle.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
This commit is contained in:
parent
4136e38af7
commit
3768f69857
1 changed files with 2 additions and 5 deletions
|
@ -1516,7 +1516,7 @@ xfs_attr_node_remove_attr(
|
||||||
struct xfs_attr_item *attr)
|
struct xfs_attr_item *attr)
|
||||||
{
|
{
|
||||||
struct xfs_da_args *args = attr->xattri_da_args;
|
struct xfs_da_args *args = attr->xattri_da_args;
|
||||||
struct xfs_da_state *state = NULL;
|
struct xfs_da_state *state = xfs_da_state_alloc(args);
|
||||||
int retval = 0;
|
int retval = 0;
|
||||||
int error = 0;
|
int error = 0;
|
||||||
|
|
||||||
|
@ -1526,8 +1526,6 @@ xfs_attr_node_remove_attr(
|
||||||
* attribute entry after any split ops.
|
* attribute entry after any split ops.
|
||||||
*/
|
*/
|
||||||
args->attr_filter |= XFS_ATTR_INCOMPLETE;
|
args->attr_filter |= XFS_ATTR_INCOMPLETE;
|
||||||
state = xfs_da_state_alloc(args);
|
|
||||||
state->inleaf = 0;
|
|
||||||
error = xfs_da3_node_lookup_int(state, &retval);
|
error = xfs_da3_node_lookup_int(state, &retval);
|
||||||
if (error)
|
if (error)
|
||||||
goto out;
|
goto out;
|
||||||
|
@ -1545,8 +1543,7 @@ xfs_attr_node_remove_attr(
|
||||||
retval = error = 0;
|
retval = error = 0;
|
||||||
|
|
||||||
out:
|
out:
|
||||||
if (state)
|
xfs_da_state_free(state);
|
||||||
xfs_da_state_free(state);
|
|
||||||
if (error)
|
if (error)
|
||||||
return error;
|
return error;
|
||||||
return retval;
|
return retval;
|
||||||
|
|
Loading…
Reference in a new issue