cifs: silence compiler warnings showing up with gcc-8.0.0
[linux-2.6-microblaze.git] / fs / cifs / cifssmb.c
index 49cf999..9ceebf3 100644 (file)
@@ -4833,10 +4833,11 @@ CIFSGetDFSRefer(const unsigned int xid, struct cifs_ses *ses,
        *target_nodes = NULL;
 
        cifs_dbg(FYI, "In GetDFSRefer the path %s\n", search_name);
-       if (ses == NULL)
+       if (ses == NULL || ses->tcon_ipc == NULL)
                return -ENODEV;
+
 getDFSRetry:
-       rc = smb_init(SMB_COM_TRANSACTION2, 15, NULL, (void **) &pSMB,
+       rc = smb_init(SMB_COM_TRANSACTION2, 15, ses->tcon_ipc, (void **) &pSMB,
                      (void **) &pSMBr);
        if (rc)
                return rc;
@@ -4844,7 +4845,7 @@ getDFSRetry:
        /* server pointer checked in called function,
        but should never be null here anyway */
        pSMB->hdr.Mid = get_next_mid(ses->server);
-       pSMB->hdr.Tid = ses->ipc_tid;
+       pSMB->hdr.Tid = ses->tcon_ipc->tid;
        pSMB->hdr.Uid = ses->Suid;
        if (ses->capabilities & CAP_STATUS32)
                pSMB->hdr.Flags2 |= SMBFLG2_ERR_STATUS;
@@ -6342,9 +6343,7 @@ SetEARetry:
        pSMB->InformationLevel =
                cpu_to_le16(SMB_SET_FILE_EA);
 
-       parm_data =
-               (struct fealist *) (((char *) &pSMB->hdr.Protocol) +
-                                      offset);
+       parm_data = (void *)pSMB + offsetof(struct smb_hdr, Protocol) + offset;
        pSMB->ParameterOffset = cpu_to_le16(param_offset);
        pSMB->DataOffset = cpu_to_le16(offset);
        pSMB->SetupCount = 1;