]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ksmdb: use cmd helper variable in smb2_get_ksmbd_tcon()
authorRalph Boehme <slow@samba.org>
Tue, 5 Oct 2021 05:03:40 +0000 (07:03 +0200)
committerSteve French <stfrench@microsoft.com>
Sun, 7 Nov 2021 04:52:06 +0000 (23:52 -0500)
Use cmd helper variable in smb2_get_ksmbd_tcon().

Cc: Tom Talpey <tom@talpey.com>
Cc: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Cc: Steve French <smfrench@gmail.com>
Cc: Hyunchul Lee <hyc.lee@gmail.com>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Ralph Boehme <slow@samba.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/ksmbd/smb2pdu.c

index 7e448df3f8474c49cea0e1a361f4220caf83abca..eb23c44c1c85e4cca85390889eb6dd165985ce6e 100644 (file)
@@ -94,12 +94,13 @@ struct channel *lookup_chann_list(struct ksmbd_session *sess, struct ksmbd_conn
 int smb2_get_ksmbd_tcon(struct ksmbd_work *work)
 {
        struct smb2_hdr *req_hdr = work->request_buf;
+       unsigned int cmd = le16_to_cpu(req_hdr->Command);
        int tree_id;
 
        work->tcon = NULL;
-       if (work->conn->ops->get_cmd_val(work) == SMB2_TREE_CONNECT_HE ||
-           work->conn->ops->get_cmd_val(work) ==  SMB2_CANCEL_HE ||
-           work->conn->ops->get_cmd_val(work) ==  SMB2_LOGOFF_HE) {
+       if (cmd == SMB2_TREE_CONNECT_HE ||
+           cmd ==  SMB2_CANCEL_HE ||
+           cmd ==  SMB2_LOGOFF_HE) {
                ksmbd_debug(SMB, "skip to check tree connect request\n");
                return 0;
        }