ksmbd: Avoid duplicate source code in ksmbd_lookup_fd_slow()
Subsystems (3)
PATCH 1/1 ksmbd: Avoid duplicate source code in ksmbd_lookup_fd_slow()
From: Markus Elfring <[email protected]>
Date: Sat, 4 Oct 2025 15:30:16 +0200
Combine two condition checks into one in this function implementation so that two statements are stored only once in the corresponding branch.
Signed-off-by Markus Elfring <[email protected]>
--- fs/smb/server/vfs_cache.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
fs/smb/server/vfs_cache.c +1 -5
@@ -470,11 +470,7 @@ struct ksmbd_file *ksmbd_lookup_fd_slow(struct ksmbd_work *work, u64 id, } fp =__ksmbd_lookup_fd (&work->sess->file_table, id); -if (!__sanity_check (work->tcon, fp)) { -ksmbd_fd_put (work, fp); -return NULL ; - } -if (fp->persistent_id != pid) { +if (!__sanity_check (work->tcon, fp) || fp->persistent_id != pid) {ksmbd_fd_put (work, fp);return NULL ; }
Signature · 1 line
2.51.0