aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2016-03-14 20:44:18 -0400
committerDave Chinner <david@fromorbit.com>2016-03-14 20:44:18 -0400
commit355cced45286ed7e710058174066628ff9ad9fa4 (patch)
treed65ab254733c0930903649e73b41ca97a98a0036
parentcc07eed8336d6452214d13e0cba770a0f5296a7f (diff)
xfs: always set rvalp in xfs_dir2_node_trim_free
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 <dan.carpenter@oracle.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
-rw-r--r--fs/xfs/libxfs/xfs_dir2_node.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/xfs/libxfs/xfs_dir2_node.c b/fs/xfs/libxfs/xfs_dir2_node.c
index 63ee03db796c..75a557432d0f 100644
--- a/fs/xfs/libxfs/xfs_dir2_node.c
+++ b/fs/xfs/libxfs/xfs_dir2_node.c
@@ -2235,6 +2235,9 @@ xfs_dir2_node_trim_free(
2235 2235
2236 dp = args->dp; 2236 dp = args->dp;
2237 tp = args->trans; 2237 tp = args->trans;
2238
2239 *rvalp = 0;
2240
2238 /* 2241 /*
2239 * Read the freespace block. 2242 * Read the freespace block.
2240 */ 2243 */
@@ -2255,7 +2258,6 @@ xfs_dir2_node_trim_free(
2255 */ 2258 */
2256 if (freehdr.nused > 0) { 2259 if (freehdr.nused > 0) {
2257 xfs_trans_brelse(tp, bp); 2260 xfs_trans_brelse(tp, bp);
2258 *rvalp = 0;
2259 return 0; 2261 return 0;
2260 } 2262 }
2261 /* 2263 /*