[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <9250af4a-993c-e86e-678c-acbd59b0861a@web.de>
Date: Tue, 3 Sep 2019 15:20:42 +0200
From: Markus Elfring <Markus.Elfring@....de>
To: cluster-devel@...hat.com,
Andreas Gruenbacher <agruenba@...hat.com>,
Bob Peterson <rpeterso@...hat.com>
Cc: LKML <linux-kernel@...r.kernel.org>,
kernel-janitors@...r.kernel.org
Subject: [PATCH] gfs2: Delete an unnecessary check before brelse()
From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Tue, 3 Sep 2019 15:10:05 +0200
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.
Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
fs/gfs2/dir.c | 3 +--
1 file changed, 1 insertion(+), 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,
sort_offset : entries, copied);
out_free:
for(i = 0; i < leaf; i++)
- if (larr[i])
- brelse(larr[i]);
+ brelse(larr[i]);
kvfree(larr);
out:
return error;
--
2.23.0
Powered by blists - more mailing lists