Commit 8e4f2e8a authored by Volker Lendecke's avatar Volker Lendecke Committed by Steve French

Slightly streamline SendReceive[2]

Slightly streamline SendReceive[2]

Remove an else branch by naming the error condition what it is
Signed-off-by: default avatarVolker Lendecke <vl@samba.org>
Signed-off-by: default avatarSteve French <sfrench@us.ibm.com>
parent 829049cb
...@@ -583,10 +583,8 @@ SendReceive2(const unsigned int xid, struct cifsSesInfo *ses, ...@@ -583,10 +583,8 @@ SendReceive2(const unsigned int xid, struct cifsSesInfo *ses,
wait_for_response(ses, midQ, timeout, 10 * HZ); wait_for_response(ses, midQ, timeout, 10 * HZ);
spin_lock(&GlobalMid_Lock); spin_lock(&GlobalMid_Lock);
if (midQ->resp_buf) {
spin_unlock(&GlobalMid_Lock); if (midQ->resp_buf == NULL) {
receive_len = midQ->resp_buf->smb_buf_length;
} else {
cERROR(1, ("No response to cmd %d mid %d", cERROR(1, ("No response to cmd %d mid %d",
midQ->command, midQ->mid)); midQ->command, midQ->mid));
if (midQ->midState == MID_REQUEST_SUBMITTED) { if (midQ->midState == MID_REQUEST_SUBMITTED) {
...@@ -614,6 +612,9 @@ SendReceive2(const unsigned int xid, struct cifsSesInfo *ses, ...@@ -614,6 +612,9 @@ SendReceive2(const unsigned int xid, struct cifsSesInfo *ses,
return rc; return rc;
} }
spin_unlock(&GlobalMid_Lock);
receive_len = midQ->resp_buf->smb_buf_length;
if (receive_len > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE) { if (receive_len > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE) {
cERROR(1, ("Frame too large received. Length: %d Xid: %d", cERROR(1, ("Frame too large received. Length: %d Xid: %d",
receive_len, xid)); receive_len, xid));
...@@ -773,10 +774,7 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses, ...@@ -773,10 +774,7 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses,
wait_for_response(ses, midQ, timeout, 10 * HZ); wait_for_response(ses, midQ, timeout, 10 * HZ);
spin_lock(&GlobalMid_Lock); spin_lock(&GlobalMid_Lock);
if (midQ->resp_buf) { if (midQ->resp_buf == NULL) {
spin_unlock(&GlobalMid_Lock);
receive_len = midQ->resp_buf->smb_buf_length;
} else {
cERROR(1, ("No response for cmd %d mid %d", cERROR(1, ("No response for cmd %d mid %d",
midQ->command, midQ->mid)); midQ->command, midQ->mid));
if (midQ->midState == MID_REQUEST_SUBMITTED) { if (midQ->midState == MID_REQUEST_SUBMITTED) {
...@@ -804,6 +802,9 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses, ...@@ -804,6 +802,9 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses,
return rc; return rc;
} }
spin_unlock(&GlobalMid_Lock);
receive_len = midQ->resp_buf->smb_buf_length;
if (receive_len > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE) { if (receive_len > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE) {
cERROR(1, ("Frame too large received. Length: %d Xid: %d", cERROR(1, ("Frame too large received. Length: %d Xid: %d",
receive_len, xid)); receive_len, xid));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment