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

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

 



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@xxxxxxxxxx>
---
 fs/cifs/smb2pdu.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index 1e64175aa5bd..91c134953b9b 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)
-- 
2.31.1




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

  Powered by Linux