[PATCH] befs: Delete an unnecessary check before brelse()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 3 Sep 2019 14:04: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@xxxxxxxxxxxxxxxxxxxxx>
---
 fs/befs/btree.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/fs/befs/btree.c b/fs/befs/btree.c
index 1b7e0f7128d6..a293e9ce1410 100644
--- a/fs/befs/btree.c
+++ b/fs/befs/btree.c
@@ -194,10 +194,7 @@ befs_bt_read_node(struct super_block *sb, const befs_data_stream *ds,
 	uint off = 0;

 	befs_debug(sb, "---> %s", __func__);
-
-	if (node->bh)
-		brelse(node->bh);
-
+	brelse(node->bh);
 	node->bh = befs_read_datastream(sb, ds, node_off, &off);
 	if (!node->bh) {
 		befs_error(sb, "%s failed to read "
--
2.23.0





[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux