Commit 2b2bdfba authored by Steve French's avatar Steve French

[CIFS] Streamline SendReceive[2] by using "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 8e4f2e8a
...@@ -619,7 +619,11 @@ SendReceive2(const unsigned int xid, struct cifsSesInfo *ses, ...@@ -619,7 +619,11 @@ SendReceive2(const unsigned int xid, struct cifsSesInfo *ses,
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));
rc = -EIO; rc = -EIO;
} else { /* rcvd frame is ok */ goto out;
}
/* rcvd frame is ok */
if (midQ->resp_buf && if (midQ->resp_buf &&
(midQ->midState == MID_RESPONSE_RECEIVED)) { (midQ->midState == MID_RESPONSE_RECEIVED)) {
...@@ -662,7 +666,6 @@ SendReceive2(const unsigned int xid, struct cifsSesInfo *ses, ...@@ -662,7 +666,6 @@ SendReceive2(const unsigned int xid, struct cifsSesInfo *ses,
rc = -EIO; rc = -EIO;
cFYI(1, ("Bad MID state?")); cFYI(1, ("Bad MID state?"));
} }
}
out: out:
DeleteMidQEntry(midQ); DeleteMidQEntry(midQ);
...@@ -809,7 +812,10 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses, ...@@ -809,7 +812,10 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses,
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));
rc = -EIO; rc = -EIO;
} else { /* rcvd frame is ok */ goto out;
}
/* rcvd frame is ok */
if (midQ->resp_buf && out_buf if (midQ->resp_buf && out_buf
&& (midQ->midState == MID_RESPONSE_RECEIVED)) { && (midQ->midState == MID_RESPONSE_RECEIVED)) {
...@@ -846,7 +852,6 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses, ...@@ -846,7 +852,6 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses,
rc = -EIO; rc = -EIO;
cERROR(1, ("Bad MID state?")); 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