|
@@ -1240,15 +1240,19 @@ SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree,
|
|
|
goto tcon_exit;
|
|
|
}
|
|
|
|
|
|
- if (rsp->ShareType & SMB2_SHARE_TYPE_DISK)
|
|
|
+ switch (rsp->ShareType) {
|
|
|
+ case SMB2_SHARE_TYPE_DISK:
|
|
|
cifs_dbg(FYI, "connection to disk share\n");
|
|
|
- else if (rsp->ShareType & SMB2_SHARE_TYPE_PIPE) {
|
|
|
+ break;
|
|
|
+ case SMB2_SHARE_TYPE_PIPE:
|
|
|
tcon->ipc = true;
|
|
|
cifs_dbg(FYI, "connection to pipe share\n");
|
|
|
- } else if (rsp->ShareType & SMB2_SHARE_TYPE_PRINT) {
|
|
|
- tcon->print = true;
|
|
|
+ break;
|
|
|
+ case SMB2_SHARE_TYPE_PRINT:
|
|
|
+ tcon->ipc = true;
|
|
|
cifs_dbg(FYI, "connection to printer\n");
|
|
|
- } else {
|
|
|
+ break;
|
|
|
+ default:
|
|
|
cifs_dbg(VFS, "unknown share type %d\n", rsp->ShareType);
|
|
|
rc = -EOPNOTSUPP;
|
|
|
goto tcon_error_exit;
|