ksmbd: Avoid duplicate variable assignment in ksmbd_vfs_path_lookup()
Subsystems (3)
PATCH 1/1 ksmbd: Avoid duplicate variable assignment in ksmbd_vfs_path_lookup()
From: Markus Elfring <[email protected]>
Date: Sat, 4 Oct 2025 18:56:18 +0200
Move a variable assignment into an else branch so that the variable will not be reassigned in case an empty string was detected in this function implementation.
Signed-off-by Markus Elfring <[email protected]>
--- fs/smb/server/vfs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/smb/server/vfs.c +2 -1
@@ -73,7 +73,7 @@ static int ksmbd_vfs_path_lookup(struct ksmbd_share_config *share_conf, {struct qstr last; struct filename *filename __free(putname) = NULL; -const struct path *root_share_path = &share_conf->vfs_path; +const struct path *root_share_path;int err, type;struct dentry *d;
@@ -82,6 +82,7 @@ static int ksmbd_vfs_path_lookup(struct ksmbd_share_config *share_conf, root_share_path =NULL ; }else { flags |=LOOKUP_BENEATH ; + root_share_path = &share_conf->vfs_path; } filename =getname_kernel (pathname);
Signature · 1 line
2.51.0