PCI: tegra: Add debugfs support
[firefly-linux-kernel-4.4.55.git] / fs / cifs / connect.c
index 8813ff776ba3a988e2773147f86406e5013d9047..20d75b8ddb26a815c8c21fcea9639a5d48e909a8 100644 (file)
@@ -2144,6 +2144,9 @@ cifs_get_tcp_session(struct smb_vol *volume_info)
               sizeof(tcp_ses->srcaddr));
        memcpy(&tcp_ses->dstaddr, &volume_info->dstaddr,
                sizeof(tcp_ses->dstaddr));
+#ifdef CONFIG_CIFS_SMB2
+       get_random_bytes(tcp_ses->client_guid, SMB2_CLIENT_GUID_SIZE);
+#endif
        /*
         * at this point we are the only ones with the pointer
         * to the struct since the kernel thread not created yet
@@ -2225,7 +2228,7 @@ static int match_session(struct cifs_ses *ses, struct smb_vol *vol)
                            vol->username ? vol->username : "",
                            CIFS_MAX_USERNAME_LEN))
                        return 0;
-               if (strlen(vol->username) != 0 &&
+               if ((vol->username && strlen(vol->username) != 0) &&
                    ses->password != NULL &&
                    strncmp(ses->password,
                            vol->password ? vol->password : "",