Skip to content

Commit

Permalink
ext4: remove unnecessary conditionals
Browse files Browse the repository at this point in the history
iput() has already handled null and non-null parameter, so it is no
need to use if().

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
Link: https://lore.kernel.org/r/20220411032337.2517465-1-lv.ruyi@zte.com.cn
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
  • Loading branch information
Lv Ruyi authored and tytso committed May 13, 2022
1 parent af2b327 commit 784a099
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions fs/ext4/fast_commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -1659,8 +1659,7 @@ static int ext4_fc_replay_create(struct super_block *sb, struct ext4_fc_tl *tl,
set_nlink(inode, 1);
ext4_mark_inode_dirty(NULL, inode);
out:
if (inode)
iput(inode);
iput(inode);
return ret;
}

Expand Down
3 changes: 1 addition & 2 deletions fs/ext4/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -3363,8 +3363,7 @@ static int ext4_symlink(struct user_namespace *mnt_userns, struct inode *dir,
err = ext4_add_nondir(handle, dentry, &inode);
if (handle)
ext4_journal_stop(handle);
if (inode)
iput(inode);
iput(inode);
goto out_free_encrypted_link;

err_drop_inode:
Expand Down

0 comments on commit 784a099

Please sign in to comment.