SMB3: Fix endian warning
authorSteve French <smfrench@gmail.com>
Tue, 19 Sep 2017 16:43:47 +0000 (11:43 -0500)
committerSteve French <smfrench@gmail.com>
Wed, 20 Sep 2017 06:38:44 +0000 (01:38 -0500)
Multi-dialect negotiate patch had a minor endian error.

Signed-off-by: Steve French <smfrench@gmail.com>
Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
CC: Stable <stable@vger.kernel.org> # 4.13+
fs/cifs/smb2pdu.c

index b0eaebe627e9e8929b3ccc1d4acafa13ab216232..b4c58a1db1ae6d6873ea0871d4e116295eadcf1a 100644 (file)
@@ -570,10 +570,11 @@ SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses)
                        /* ops set to 3.0 by default for default so update */
                        ses->server->ops = &smb21_operations;
                }
-       } else if (rsp->DialectRevision != ses->server->vals->protocol_id) {
+       } else if (le16_to_cpu(rsp->DialectRevision) !=
+                               ses->server->vals->protocol_id) {
                /* if requested single dialect ensure returned dialect matched */
                cifs_dbg(VFS, "Illegal 0x%x dialect returned: not requested\n",
-                       cpu_to_le16(rsp->DialectRevision));
+                       le16_to_cpu(rsp->DialectRevision));
                return -EIO;
        }