]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ksmbd_vfs_rename(): vfs_path_parent_lookup() accepts ERR_PTR() as name
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 31 Oct 2025 05:13:32 +0000 (01:13 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Tue, 13 Jan 2026 20:18:07 +0000 (15:18 -0500)
no need to check in the caller

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/smb/server/vfs.c

index a972261168407da312bb37ae950691989f6addbb..30b65b667b96efa41534f156e2a57c6dd2b7cb8e 100644 (file)
@@ -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 @@ out2:
        }
 out1:
        putname(to);
-revert_fsids:
        ksmbd_revert_fsids(work);
        return err;
 }