PCI: tegra: Add debugfs support
[firefly-linux-kernel-4.4.55.git] / fs / cifs / connect.c
index 8b8fe9b373f214ab2f83eed8f585fc712a50b113..20d75b8ddb26a815c8c21fcea9639a5d48e909a8 100644 (file)
@@ -2228,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 : "",