Skip to contentSkip to conversation

fs: Drop pointless 'source' check from vfs_rename()

PATCH New Jan Kara 1 participant 1 message Jul 3, 2023 VFS

lore
Share & tools
lore

Jan Kara

author reviewer
#0 lore raw

PATCH 1/1 fs: Drop pointless 'source' check from vfs_rename()

The check for 'source' being non-NULL before unlocking it is pointless as 'source' is guaranteed to exist in vfs_rename(). Drop it.

---
 fs/namei.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
fs/namei.c +1 -2
index 91171da719c5..e56ff39a79bc 100644
@@ -4874,8 +4874,7 @@ int vfs_rename(struct renamedata *rd)
 			d_exchange(old_dentry, new_dentry);
 	}
 out:
-	if (source)
-		inode_unlock(source);
+	inode_unlock(source);
 	if (target)
 		inode_unlock(target);
 	dput(new_dentry);
Signature · 1 line
2.35.3