summaryrefslogtreecommitdiff
path: root/arch/arm/mach-socfpga/mailbox_s10.c
diff options
context:
space:
mode:
authorChee Hong Ang <chee.hong.ang@intel.com>2020-08-12 09:56:22 +0800
committerLey Foon Tan <ley.foon.tan@intel.com>2020-10-09 17:53:13 +0800
commit833230ed33684f399aae84633f4992106b6d3949 (patch)
treee4284e80ec88baa4e835b48f98d56984d528a4b9 /arch/arm/mach-socfpga/mailbox_s10.c
parente3fca5072bf78f7fd7eeab027d6e83bb555def9e (diff)
arm: socfpga: mailbox: Always read mailbox responses before returning status
Mailbox driver should always check for the length of the response and read the response data before returning the response status to caller. Signed-off-by: Chee Hong Ang <chee.hong.ang@intel.com> Reviewed-by: Ley Foon Tan <ley.foon.tan@intel.com>
Diffstat (limited to 'arch/arm/mach-socfpga/mailbox_s10.c')
-rw-r--r--arch/arm/mach-socfpga/mailbox_s10.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/arch/arm/mach-socfpga/mailbox_s10.c b/arch/arm/mach-socfpga/mailbox_s10.c
index 729d9b04fa5..e8a587f0079 100644
--- a/arch/arm/mach-socfpga/mailbox_s10.c
+++ b/arch/arm/mach-socfpga/mailbox_s10.c
@@ -221,9 +221,7 @@ static __always_inline int mbox_send_cmd_common(u8 id, u32 cmd, u8 is_indirect,
if ((MBOX_RESP_CLIENT_GET(resp) ==
MBOX_CLIENT_ID_UBOOT) &&
(MBOX_RESP_ID_GET(resp) == id)) {
- ret = MBOX_RESP_ERR_GET(resp);
- if (ret)
- return ret;
+ int resp_err = MBOX_RESP_ERR_GET(resp);
if (resp_buf_len) {
buf_len = *resp_buf_len;
@@ -252,7 +250,7 @@ static __always_inline int mbox_send_cmd_common(u8 id, u32 cmd, u8 is_indirect,
buf_len--;
}
}
- return ret;
+ return resp_err;
}
}
};