Skip to content

Commit

Permalink
ext4: Remove an unnecessary check for NULL before iput()
Browse files Browse the repository at this point in the history
The iput() function 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 <elfring@users.sourceforge.net>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
  • Loading branch information
Markus Elfring authored and Theodore Ts'o committed Nov 26, 2014
1 parent 31fc006 commit bfcba2d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions fs/ext4/mballoc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2712,8 +2712,7 @@ int ext4_mb_release(struct super_block *sb)
}
kfree(sbi->s_mb_offsets);
kfree(sbi->s_mb_maxs);
if (sbi->s_buddy_cache)
iput(sbi->s_buddy_cache);
iput(sbi->s_buddy_cache);
if (sbi->s_mb_stats) {
ext4_msg(sb, KERN_INFO,
"mballoc: %u blocks %u reqs (%u success)",
Expand Down

0 comments on commit bfcba2d

Please sign in to comment.