Commit 698e96a8 authored by Volker Lendecke's avatar Volker Lendecke Committed by Steve French

Streamline SendReceiveBlockingLock: Use "goto out:" in an error condition

Streamline SendReceiveBlockingLock: Use "goto out:" in an error condition
Signed-off-by: default avatarVolker Lendecke <vl@samba.org>
Signed-off-by: default avatarSteve French <sfrench@us.ibm.com>
parent 17c8bfed
...@@ -1067,41 +1067,42 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifsTconInfo *tcon, ...@@ -1067,41 +1067,42 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifsTconInfo *tcon,
/* rcvd frame is ok */ /* rcvd frame is ok */
if (midQ->resp_buf && out_buf if ((midQ->resp_buf == NULL) || (out_buf == NULL)
&& (midQ->midState == MID_RESPONSE_RECEIVED)) { || (midQ->midState != MID_RESPONSE_RECEIVED)) {
out_buf->smb_buf_length = receive_len; rc = -EIO;
memcpy((char *)out_buf + 4, cERROR(1, ("Bad MID state?"));
(char *)midQ->resp_buf + 4, goto out;
receive_len); }
dump_smb(out_buf, 92); out_buf->smb_buf_length = receive_len;
/* convert the length into a more usable form */ memcpy((char *)out_buf + 4,
if ((receive_len > 24) && (char *)midQ->resp_buf + 4,
(ses->server->secMode & (SECMODE_SIGN_REQUIRED | receive_len);
SECMODE_SIGN_ENABLED))) {
rc = cifs_verify_signature(out_buf, dump_smb(out_buf, 92);
&ses->server->mac_signing_key, /* convert the length into a more usable form */
midQ->sequence_number+1); if ((receive_len > 24) &&
if (rc) { (ses->server->secMode & (SECMODE_SIGN_REQUIRED |
cERROR(1, ("Unexpected SMB signature")); SECMODE_SIGN_ENABLED))) {
/* BB FIXME add code to kill session */ rc = cifs_verify_signature(out_buf,
} &ses->server->mac_signing_key,
midQ->sequence_number+1);
if (rc) {
cERROR(1, ("Unexpected SMB signature"));
/* BB FIXME add code to kill session */
} }
}
*pbytes_returned = out_buf->smb_buf_length; *pbytes_returned = out_buf->smb_buf_length;
/* BB special case reconnect tid and uid here? */ /* BB special case reconnect tid and uid here? */
rc = map_smb_to_linux_error(out_buf, 0 /* no log */ ); rc = map_smb_to_linux_error(out_buf, 0 /* no log */ );
/* convert ByteCount if necessary */ /* convert ByteCount if necessary */
if (receive_len >= sizeof(struct smb_hdr) - 4 if (receive_len >= sizeof(struct smb_hdr) - 4
/* do not count RFC1001 header */ + /* do not count RFC1001 header */ +
(2 * out_buf->WordCount) + 2 /* bcc */ ) (2 * out_buf->WordCount) + 2 /* bcc */ )
BCC(out_buf) = le16_to_cpu(BCC_LE(out_buf)); BCC(out_buf) = le16_to_cpu(BCC_LE(out_buf));
} else {
rc = -EIO;
cERROR(1, ("Bad MID state?"));
}
out: out:
DeleteMidQEntry(midQ); DeleteMidQEntry(midQ);
......
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