Skip to content

Commit

Permalink
ntfs: delete unnecessary checks before calling iput()
Browse files Browse the repository at this point in the history
iput() 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.

Signed-off-by: Markus Elfring <[email protected]>
Cc: Julia Lawall <[email protected]>
Reviewed-by: Anton Altaparmakov <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
elfring authored and torvalds committed Sep 4, 2015
1 parent 35108d7 commit 917520e
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions fs/ntfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -2204,17 +2204,12 @@ static bool load_system_files(ntfs_volume *vol)
return true;
#ifdef NTFS_RW
iput_usnjrnl_err_out:
if (vol->usnjrnl_j_ino)
iput(vol->usnjrnl_j_ino);
if (vol->usnjrnl_max_ino)
iput(vol->usnjrnl_max_ino);
if (vol->usnjrnl_ino)
iput(vol->usnjrnl_ino);
iput(vol->usnjrnl_j_ino);
iput(vol->usnjrnl_max_ino);
iput(vol->usnjrnl_ino);
iput_quota_err_out:
if (vol->quota_q_ino)
iput(vol->quota_q_ino);
if (vol->quota_ino)
iput(vol->quota_ino);
iput(vol->quota_q_ino);
iput(vol->quota_ino);
iput(vol->extend_ino);
#endif /* NTFS_RW */
iput_sec_err_out:
Expand All @@ -2223,8 +2218,7 @@ static bool load_system_files(ntfs_volume *vol)
iput(vol->root_ino);
iput_logfile_err_out:
#ifdef NTFS_RW
if (vol->logfile_ino)
iput(vol->logfile_ino);
iput(vol->logfile_ino);
iput_vol_err_out:
#endif /* NTFS_RW */
iput(vol->vol_ino);
Expand Down Expand Up @@ -2254,8 +2248,7 @@ static bool load_system_files(ntfs_volume *vol)
iput(vol->mftbmp_ino);
iput_mirr_err_out:
#ifdef NTFS_RW
if (vol->mftmirr_ino)
iput(vol->mftmirr_ino);
iput(vol->mftmirr_ino);
#endif /* NTFS_RW */
return false;
}
Expand Down

0 comments on commit 917520e

Please sign in to comment.