diff mbox series

[v2,4/7] cifs: Remove the redundant null pointer check in SMB2_negotiate()

Message ID 20221029090011.79367-5-zhangxiaoxu5@huawei.com (mailing list archive)
State New, archived
Headers show
Series cifs: minor code improvements | expand

Commit Message

Zhang Xiaoxu Oct. 29, 2022, 9 a.m. UTC
The smb2_negotiate() is the only caller of function SMB2_negotiate(),
and it's already ensure the server not null, so remove the redundant
nullptr check.

Signed-off-by: Zhang Xiaoxu <zhangxiaoxu5@huawei.com>
---
 fs/cifs/smb2pdu.c | 5 -----
 1 file changed, 5 deletions(-)
diff mbox series

Patch

diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index 5cda7f029b60..11643fb25347 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -846,11 +846,6 @@  SMB2_negotiate(const unsigned int xid,
 
 	cifs_dbg(FYI, "Negotiate protocol\n");
 
-	if (!server) {
-		WARN(1, "%s: server is NULL!\n", __func__);
-		return -EIO;
-	}
-
 	rc = smb2_plain_req_init(SMB2_NEGOTIATE, NULL, server,
 				 (void **) &req, &total_len);
 	if (rc)