1 ext4: Remove an unnecessary check for NULL before iput()
3 From: Markus Elfring <elfring@users.sourceforge.net>
5 The iput() function tests whether its argument is NULL and then
6 returns immediately. Thus the test around the call is not needed.
8 This issue was detected by using the Coccinelle software.
10 Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
11 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
13 fs/ext4/mballoc.c | 3 +--
14 1 file changed, 1 insertion(+), 2 deletions(-)
16 diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
17 index 8b0f9ef..e1a2521 100644
18 --- a/fs/ext4/mballoc.c
19 +++ b/fs/ext4/mballoc.c
20 @@ -2712,8 +2712,7 @@ int ext4_mb_release(struct super_block *sb)
22 kfree(sbi->s_mb_offsets);
23 kfree(sbi->s_mb_maxs);
24 - if (sbi->s_buddy_cache)
25 - iput(sbi->s_buddy_cache);
26 + iput(sbi->s_buddy_cache);
27 if (sbi->s_mb_stats) {
28 ext4_msg(sb, KERN_INFO,
29 "mballoc: %u blocks %u reqs (%u success)",