Skip to contentSkip to conversation

befs: Delete an unnecessary check before brelse()

PATCH New Markus Elfring 1 participant 1 message Sep 3, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 befs: Delete an unnecessary check before brelse()

From: Markus Elfring <[email protected]>
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.

---
 fs/befs/btree.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
fs/befs/btree.c +1 -4
index 1b7e0f7128d6..a293e9ce1410 100644
@@ -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