Skip to contentSkip to conversation

ext4: remove useless if check

PATCH Applied Antonio Quartulli 2 participants 2 messages Jul 21, 2025 – Aug 14, 2025 ext4 file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ext4: remove useless if check

This if branch is only jumping to 'out' which is defined just after the branch itself. Hence this is if-check is a no-op and can be removed.

Address-Coverity-ID: 1647981 ("Incorrect expression (IDENTICAL_BRANCHES)")

---
 fs/ext4/namei.c | 2 --
 1 file changed, 2 deletions(-)
fs/ext4/namei.c +0 -2
index d83f91b62317..01f379f5fd04 100644
@@ -2984,8 +2984,6 @@ int ext4_init_new_dir(handle_t *handle, struct inode *dir,
 		return PTR_ERR(dir_block);
 	de = (struct ext4_dir_entry_2 *)dir_block->b_data;
 	err = ext4_init_dirblock(handle, inode, dir_block, dir->i_ino, NULL, 0);
-	if (err)
-		goto out;
 out:
 	brelse(dir_block);
 	return err;
Signature · 1 line
2.49.1
maintainer Applied
#1 lore raw
Quoted 5 lines · Antonio Quartulli

This if branch is only jumping to 'out' which is defined just after the branch itself. Hence this is if-check is a no-op and can be removed.

Applied, thanks!

[1/1] ext4: remove useless if check

      commit: f3fbaa74d999c16b5caeca779e6d7e6e6e7feed8

Best regards,

Signature · 1 line
Theodore Ts'o <[email protected]>