From d2fd405fa35f60ba4c53149428ddc443fc6d13ac Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Tue, 21 Jun 2016 15:56:34 +1000 Subject: [PATCH] xfs: always set rvalp in xfs_dir2_node_trim_free Source kernel commit 355cced45286ed7e710058174066628ff9ad9fa4 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 Signed-off-by: Christoph Hellwig Reviewed-by: Carlos Maiolino Signed-off-by: Dave Chinner --- libxfs/xfs_dir2_node.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libxfs/xfs_dir2_node.c b/libxfs/xfs_dir2_node.c index 224daa634..df599f97f 100644 --- a/libxfs/xfs_dir2_node.c +++ b/libxfs/xfs_dir2_node.c @@ -2230,6 +2230,9 @@ xfs_dir2_node_trim_free( dp = args->dp; tp = args->trans; + + *rvalp = 0; + /* * Read the freespace block. */ @@ -2250,7 +2253,6 @@ xfs_dir2_node_trim_free( */ if (freehdr.nused > 0) { xfs_trans_brelse(tp, bp); - *rvalp = 0; return 0; } /* -- 2.47.2