aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/dir.c
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2019-09-03 09:10:05 -0400
committerAndreas Gruenbacher <agruenba@redhat.com>2019-09-04 14:22:17 -0400
commitbccaef90738581038ee609e946f36812bd6fb1b3 (patch)
tree2cb18b48bc17f3e6e0d918deb799d422a4ab89e9 /fs/gfs2/dir.c
parent45eb05042d5667408d101a8c056f70a8e8ac27f6 (diff)
gfs2: Delete an unnecessary check before brelse()
The brelse() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. [The same applies to brelse() in gfs2_dir_no_add (which Coccinelle apparently missed), so fix that as well.] Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Diffstat (limited to 'fs/gfs2/dir.c')
-rw-r--r--fs/gfs2/dir.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/gfs2/dir.c b/fs/gfs2/dir.c
index 6f35d19eec25..eb9c0578978f 100644
--- a/fs/gfs2/dir.c
+++ b/fs/gfs2/dir.c
@@ -1463,8 +1463,7 @@ static int gfs2_dir_read_leaf(struct inode *inode, struct dir_context *ctx,
1463 sort_offset : entries, copied); 1463 sort_offset : entries, copied);
1464out_free: 1464out_free:
1465 for(i = 0; i < leaf; i++) 1465 for(i = 0; i < leaf; i++)
1466 if (larr[i]) 1466 brelse(larr[i]);
1467 brelse(larr[i]);
1468 kvfree(larr); 1467 kvfree(larr);
1469out: 1468out:
1470 return error; 1469 return error;