diff mbox series

[2/2] cifs: remove unreachable code in cifs_get_tcp_session()

Message ID 20250331082251.123381-3-r.smirnov@omp.ru (mailing list archive)
State New
Headers show
Series cifs: fix integer overflow in match_server() | expand

Commit Message

Roman Smirnov March 31, 2025, 8:22 a.m. UTC
echo_interval is checked at mount time, the code has become
unreachable.

Signed-off-by: Roman Smirnov <r.smirnov@omp.ru>
---
 fs/smb/client/connect.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/fs/smb/client/connect.c b/fs/smb/client/connect.c
index 73f93a35eedd..84efcb541ab2 100644
--- a/fs/smb/client/connect.c
+++ b/fs/smb/client/connect.c
@@ -1729,12 +1729,8 @@  cifs_get_tcp_session(struct smb3_fs_context *ctx,
 	 */
 	tcp_ses->tcpStatus = CifsNew;
 	++tcp_ses->srv_count;
+	tcp_ses->echo_interval = ctx->echo_interval * HZ;
 
-	if (ctx->echo_interval >= SMB_ECHO_INTERVAL_MIN &&
-		ctx->echo_interval <= SMB_ECHO_INTERVAL_MAX)
-		tcp_ses->echo_interval = ctx->echo_interval * HZ;
-	else
-		tcp_ses->echo_interval = SMB_ECHO_INTERVAL_DEFAULT * HZ;
 	if (tcp_ses->rdma) {
 #ifndef CONFIG_CIFS_SMB_DIRECT
 		cifs_dbg(VFS, "CONFIG_CIFS_SMB_DIRECT is not enabled\n");