]> Git Repo - linux.git/commitdiff
xfs: always set rvalp in xfs_dir2_node_trim_free
authorChristoph Hellwig <[email protected]>
Tue, 15 Mar 2016 00:44:18 +0000 (11:44 +1100)
committerDave Chinner <[email protected]>
Tue, 15 Mar 2016 00:44:18 +0000 (11:44 +1100)
xfs_dir2_node_trim_free can return with setting the rvalp argument
pointer.  Initialize it to 0 at the beginning of the function and
only update it to 1 if we succeeded trimming a freespace block.

Reported-by: Dan Carpenter <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
Reviewed-by: Carlos Maiolino <[email protected]>
Signed-off-by: Dave Chinner <[email protected]>
fs/xfs/libxfs/xfs_dir2_node.c

index 63ee03db796ca9a55b9f9f10a427a6fd539c30d4..75a557432d0f87fdb4cfa866332c403023d169dc 100644 (file)
@@ -2235,6 +2235,9 @@ xfs_dir2_node_trim_free(
 
        dp = args->dp;
        tp = args->trans;
+
+       *rvalp = 0;
+
        /*
         * Read the freespace block.
         */
@@ -2255,7 +2258,6 @@ xfs_dir2_node_trim_free(
         */
        if (freehdr.nused > 0) {
                xfs_trans_brelse(tp, bp);
-               *rvalp = 0;
                return 0;
        }
        /*
This page took 0.054862 seconds and 4 git commands to generate.