Skip to contentSkip to conversation

ocfs2: Remove redundant conditional before iput

PATCH Applied Yi Li 2 participants 2 messages Dec 31, 2020 OCFS2

lore
Share & tools
lore

Yi Li

author
#0 lore raw

PATCH 1/1 ocfs2: Remove redundant conditional before iput

iput handles NULL pointers gracefully, so there's no need to check the pointer before the call.

---
 fs/ocfs2/super.c | 2 --
 1 file changed, 2 deletions(-)
fs/ocfs2/super.c +0 -2
index 2febc76e9de7..079f8826993e 100644
@@ -973,8 +973,6 @@ static void ocfs2_disable_quotas(struct ocfs2_super *osb)
 		 * quota files */
 		dquot_disable(sb, type, DQUOT_USAGE_ENABLED |
 					DQUOT_LIMITS_ENABLED);
-		if (!inode)
-			continue;
 		iput(inode);
 	}
 }
Signature · 1 line
2.25.3
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Yi Li

iput handles NULL pointers gracefully, so there's no need to check the pointer before the call.

Quoted 18 lines
---
 fs/ocfs2/super.c | 2 --
 1 file changed, 2 deletions(-)
fs/ocfs2/super.c +0 -2
index 2febc76e9de7..079f8826993e 100644
@@ -973,8 +973,6 @@ static void ocfs2_disable_quotas(struct ocfs2_super *osb)
 		 * quota files */
 		dquot_disable(sb, type, DQUOT_USAGE_ENABLED |
 					DQUOT_LIMITS_ENABLED);
-		if (!inode)
-			continue;
 		iput(inode);
 	}
 }