소스 검색

ext4: Remove an unnecessary check for NULL before iput()

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>
Markus Elfring 11 년 전
부모
커밋
bfcba2d035
1개의 변경된 파일1개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 2
      fs/ext4/mballoc.c

+ 1 - 2
fs/ext4/mballoc.c

@@ -2712,8 +2712,7 @@ int ext4_mb_release(struct super_block *sb)
 	}
 	}
 	kfree(sbi->s_mb_offsets);
 	kfree(sbi->s_mb_offsets);
 	kfree(sbi->s_mb_maxs);
 	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) {
 	if (sbi->s_mb_stats) {
 		ext4_msg(sb, KERN_INFO,
 		ext4_msg(sb, KERN_INFO,
 		       "mballoc: %u blocks %u reqs (%u success)",
 		       "mballoc: %u blocks %u reqs (%u success)",