mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: linux-cifs@vger.kernel.org, Namjae Jeon <linkinjeon@kernel.org>,
	Sergey Senozhatsky <senozhatsky@chromium.org>,
	Steve French <smfrench@gmail.com>, Tom Talpey <tom@talpey.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	kernel-janitors@vger.kernel.org, Neil Brown <neil@brown.name>,
	Stefan Metzmacher <metze@samba.org>
Subject: [PATCH] ksmbd: Avoid duplicate variable assignment in ksmbd_vfs_path_lookup()
Date: Sat, 4 Oct 2025 19:09:35 +0200	[thread overview]
Message-ID: <9394c1f6-24ef-4557-b9b8-4e3a96659ed3@web.de> (raw)

From: Markus Elfring <elfring@users.sourceforge.net>
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 <elfring@users.sourceforge.net>
---
 fs/smb/server/vfs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/smb/server/vfs.c b/fs/smb/server/vfs.c
index 891ed2dc2b73..bef6761760a4 100644
--- a/fs/smb/server/vfs.c
+++ b/fs/smb/server/vfs.c
@@ -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);
-- 
2.51.0


                 reply	other threads:[~2025-10-04 17:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9394c1f6-24ef-4557-b9b8-4e3a96659ed3@web.de \
    --to=markus.elfring@web.de \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linkinjeon@kernel.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=metze@samba.org \
    --cc=neil@brown.name \
    --cc=senozhatsky@chromium.org \
    --cc=smfrench@gmail.com \
    --cc=tom@talpey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®