diff options
author | Volker Lendecke <vl@samba.org> | 2008-12-06 16:22:15 +0100 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2008-12-26 03:29:12 +0100 |
commit | 8e4f2e8a1e5cfa07c5b2731accee0e6eb4c64575 (patch) | |
tree | 1708d4173cf39a48639aaeb9ef1e6085ca16ba44 /fs/cifs | |
parent | Check the return value of cifs_sign_smb[2] (diff) | |
download | linux-8e4f2e8a1e5cfa07c5b2731accee0e6eb4c64575.tar.xz linux-8e4f2e8a1e5cfa07c5b2731accee0e6eb4c64575.zip |
Slightly streamline SendReceive[2]
Slightly streamline SendReceive[2]
Remove an else branch by naming the error condition what it is
Signed-off-by: Volker Lendecke <vl@samba.org>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs')
-rw-r--r-- | fs/cifs/transport.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c index dc2d1b0bba58..01b3aa5f928b 100644 --- a/fs/cifs/transport.c +++ b/fs/cifs/transport.c @@ -583,10 +583,8 @@ SendReceive2(const unsigned int xid, struct cifsSesInfo *ses, wait_for_response(ses, midQ, timeout, 10 * HZ); spin_lock(&GlobalMid_Lock); - if (midQ->resp_buf) { - spin_unlock(&GlobalMid_Lock); - receive_len = midQ->resp_buf->smb_buf_length; - } else { + + if (midQ->resp_buf == NULL) { cERROR(1, ("No response to cmd %d mid %d", midQ->command, midQ->mid)); if (midQ->midState == MID_REQUEST_SUBMITTED) { @@ -614,6 +612,9 @@ SendReceive2(const unsigned int xid, struct cifsSesInfo *ses, return rc; } + spin_unlock(&GlobalMid_Lock); + receive_len = midQ->resp_buf->smb_buf_length; + if (receive_len > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE) { cERROR(1, ("Frame too large received. Length: %d Xid: %d", receive_len, xid)); @@ -773,10 +774,7 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses, wait_for_response(ses, midQ, timeout, 10 * HZ); spin_lock(&GlobalMid_Lock); - if (midQ->resp_buf) { - spin_unlock(&GlobalMid_Lock); - receive_len = midQ->resp_buf->smb_buf_length; - } else { + if (midQ->resp_buf == NULL) { cERROR(1, ("No response for cmd %d mid %d", midQ->command, midQ->mid)); if (midQ->midState == MID_REQUEST_SUBMITTED) { @@ -804,6 +802,9 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses, return rc; } + spin_unlock(&GlobalMid_Lock); + receive_len = midQ->resp_buf->smb_buf_length; + if (receive_len > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE) { cERROR(1, ("Frame too large received. Length: %d Xid: %d", receive_len, xid)); |