[PATCH 3/3] ext4: Remove some dead code in the error handling path of ext4_mb_init_cache()
From: Christophe JAILLET
Date: Fri Jan 03 2025 - 09:02:18 EST
'bh' is known to be a non-NULL value if the error handling path is called,
so there is no need to test for it.
This slighly simplifies the code.
Signed-off-by: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
---
Compile tested only.
---
fs/ext4/mballoc.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index e536c0e35ca8..c22f7b8fd941 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -1430,12 +1430,11 @@ static int ext4_mb_init_cache(struct folio *folio, char *incore, gfp_t gfp)
folio_mark_uptodate(folio);
out:
- if (bh) {
- for (i = 0; i < groups_per_page; i++)
- brelse(bh[i]);
- if (bh != &bhs)
- kfree(bh);
- }
+ for (i = 0; i < groups_per_page; i++)
+ brelse(bh[i]);
+ if (bh != &bhs)
+ kfree(bh);
+
return err;
}
--
2.47.1