mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-11 23:47:24 +00:00
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>
This commit is contained in:
parent
e3fca5072b
commit
833230ed33
1 changed files with 2 additions and 4 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue