ext4: remove useless if check
authorAntonio Quartulli <antonio@mandelbit.com>
Mon, 21 Jul 2025 20:09:02 +0000 (22:09 +0200)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 13 Aug 2025 03:15:05 +0000 (23:15 -0400)
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)")
Signed-off-by: Antonio Quartulli <antonio@mandelbit.com>
Link: https://patch.msgid.link/20250721200902.1071-1-antonio@mandelbit.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/namei.c

index d83f91b623174b85f168e5ab3553cadd7075303b..01f379f5fd04a1c90b888bcf855cd40be0f14b2c 100644 (file)
@@ -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;