[PATCH] trivial coverity cleanup from multichannel series

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Coverity complains about printks inside of spinlocks - move the
cifs_debug print call in cifs_try_adding_channels outside of the
spinlock.  See attached patch.

c

-- 
Thanks,

Steve
From 95305b4141ece91e77691860b70cdf4d28537a7f Mon Sep 17 00:00:00 2001
From: Steve French <stfrench@xxxxxxxxxxxxx>
Date: Mon, 15 Nov 2021 21:00:08 -0600
Subject: [PATCH] cifs: move debug print out of spinlock

It is better to print debug messages outside of the chan_lock
spinlock where possible.

CC: Shyam Prasad N <sprasad@xxxxxxxxxxxxx>
Addresses-Coverity: 1493854 ("Thread deadlock")
Signed-off-by: Steve French <stfrench@xxxxxxxxxxxxx>
---
 fs/cifs/sess.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c
index 2c10b186ed6e..7db8b22edac9 100644
--- a/fs/cifs/sess.c
+++ b/fs/cifs/sess.c
@@ -95,9 +95,9 @@ int cifs_try_adding_channels(struct cifs_sb_info *cifs_sb, struct cifs_ses *ses)
 	}
 
 	if (!(ses->server->capabilities & SMB2_GLOBAL_CAP_MULTI_CHANNEL)) {
-		cifs_dbg(VFS, "server %s does not support multichannel\n", ses->server->hostname);
 		ses->chan_max = 1;
 		spin_unlock(&ses->chan_lock);
+		cifs_dbg(VFS, "server %s does not support multichannel\n", ses->server->hostname);
 		return 0;
 	}
 	spin_unlock(&ses->chan_lock);
-- 
2.32.0


[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux