summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandra Diupina <adiupina@astralinux.ru>2025-03-19 17:28:58 +0300
committerSteve French <stfrench@microsoft.com>2025-03-24 17:45:07 +0300
commitb4885bd5935bb26f0a414ad55679a372e53f9b9b (patch)
treecd8c718e9cddb71a41f3b91e084ca77984f2e6cc
parentf089ee00f205a6e487291f347ea99bf26370643a (diff)
downloadlinux-b4885bd5935bb26f0a414ad55679a372e53f9b9b.tar.xz
cifs: avoid NULL pointer dereference in dbg call
cifs_server_dbg() implies server to be non-NULL so move call under condition to avoid NULL pointer dereference. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: e79b0332ae06 ("cifs: ignore cached share root handle closing errors") Cc: stable@vger.kernel.org Signed-off-by: Alexandra Diupina <adiupina@astralinux.ru> Signed-off-by: Steve French <stfrench@microsoft.com>
-rw-r--r--fs/smb/client/smb2misc.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/smb/client/smb2misc.c b/fs/smb/client/smb2misc.c
index f3c4b70b77b9..cddf273c14ae 100644
--- a/fs/smb/client/smb2misc.c
+++ b/fs/smb/client/smb2misc.c
@@ -816,11 +816,12 @@ smb2_handle_cancelled_close(struct cifs_tcon *tcon, __u64 persistent_fid,
WARN_ONCE(tcon->tc_count < 0, "tcon refcount is negative");
spin_unlock(&cifs_tcp_ses_lock);
- if (tcon->ses)
+ if (tcon->ses) {
server = tcon->ses->server;
-
- cifs_server_dbg(FYI, "tid=0x%x: tcon is closing, skipping async close retry of fid %llu %llu\n",
- tcon->tid, persistent_fid, volatile_fid);
+ cifs_server_dbg(FYI,
+ "tid=0x%x: tcon is closing, skipping async close retry of fid %llu %llu\n",
+ tcon->tid, persistent_fid, volatile_fid);
+ }
return 0;
}