[PATCH v4 25/59] ksmbd_vfs_rename(): vfs_path_parent_lookup() accepts ERR_PTR() as name

Al Viro
2026-01-08T07:36:53Z

no need to check in the caller

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
fs/smb/server/vfs.c | 5 -----
1 file changed, 5 deletions(-)

diff --git a/fs/smb/server/vfs.c b/fs/smb/server/vfs.c
index a97226116840..30b65b667b96 100644
--- a/fs/smb/server/vfs.c
+++ b/fs/smb/server/vfs.c
@@ -674,10 +674,6 @@ int ksmbd_vfs_rename(struct ksmbd_work *work, const struct path *old_path,
return -ENOMEM;

to = getname_kernel(newname);
- if (IS_ERR(to)) {
- err = PTR_ERR(to);
- goto revert_fsids;
- }

retry:
err = vfs_path_parent_lookup(to, lookup_flags | LOOKUP_BENEATH,
@@ -737,7 +733,6 @@ int ksmbd_vfs_rename(struct ksmbd_work *work, const struct path *old_path,
}
out1:
putname(to);
-revert_fsids:
ksmbd_revert_fsids(work);
return err;
}
--
2.47.3