diff options
author | Eddie James <eajames@linux.ibm.com> | 2022-04-26 10:49:55 -0500 |
---|---|---|
committer | Joel Stanley <joel@jms.id.au> | 2022-09-27 16:57:17 +0930 |
commit | 7326939faa4b8d078dd2b8cddc36b5758d9b984c (patch) | |
tree | 7497e7463d3afba847aee2bbd0249f443244dd52 /drivers/fsi | |
parent | f157555ea3b0f1f7ff19ca7d52576ab231fabfad (diff) | |
download | lwn-7326939faa4b8d078dd2b8cddc36b5758d9b984c.tar.gz lwn-7326939faa4b8d078dd2b8cddc36b5758d9b984c.zip |
fsi: occ: Fix checksum failure mode
Change the checksum errno to something different than the errno
used for a bad SBE message. In addition, don't set the user's
response length to the data length in this case, since it's not
SBE FFDC.
Signed-off-by: Eddie James <eajames@linux.ibm.com>
Link: https://lore.kernel.org/r/20220426154956.27205-2-eajames@linux.ibm.com
Signed-off-by: Joel Stanley <joel@jms.id.au>
Diffstat (limited to 'drivers/fsi')
-rw-r--r-- | drivers/fsi/fsi-occ.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/fsi/fsi-occ.c b/drivers/fsi/fsi-occ.c index c9cc75fbdfb9..3d04e8baecbb 100644 --- a/drivers/fsi/fsi-occ.c +++ b/drivers/fsi/fsi-occ.c @@ -246,7 +246,7 @@ static int occ_verify_checksum(struct occ *occ, struct occ_response *resp, if (checksum != checksum_resp) { dev_err(occ->dev, "Bad checksum: %04x!=%04x\n", checksum, checksum_resp); - return -EBADMSG; + return -EBADE; } return 0; @@ -575,8 +575,11 @@ int fsi_occ_submit(struct device *dev, const void *request, size_t req_len, dev_dbg(dev, "resp_status=%02x resp_data_len=%d\n", resp->return_status, resp_data_length); - occ->client_response_size = resp_data_length + 7; rc = occ_verify_checksum(occ, resp, resp_data_length); + if (rc) + goto done; + + occ->client_response_size = resp_data_length + 7; done: *resp_len = occ->client_response_size; |