The check for 'source' being non-NULL before unlocking it is pointless as 'source' is guaranteed to exist in vfs_rename(). Drop it. Reported-by: kernel test robot <lkp@xxxxxxxxx> Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx> Closes: https://lore.kernel.org/r/202307030026.9sE2pk2x-lkp@xxxxxxxxx/ Signed-off-by: Jan Kara <jack@xxxxxxx> --- fs/namei.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/namei.c b/fs/namei.c index 91171da719c5..e56ff39a79bc 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -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); -- 2.35.3