mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-18 10:34:19 +00:00
fix(rss): fix bound check during protocol selection
Fix the wrong placement of the closing parenthesis in the second condition check that resulted in the incorrect calculation of the MHU message size. Also, format the code for readability. Signed-off-by: Vijayenthiran Subramaniam <vijayenthiran.subramaniam@arm.com> Change-Id: I0e012f3ff00bae2dfc12cdb1c2c636fc6c0a0b55
This commit is contained in:
parent
5cd10848be
commit
f754bd4667
1 changed files with 4 additions and 2 deletions
|
@ -59,8 +59,10 @@ static uint8_t select_protocol_version(const psa_invec *in_vec, size_t in_len,
|
|||
* messages due to ATU configuration costs to allow access to the
|
||||
* pointers.
|
||||
*/
|
||||
if ((comms_embed_msg_min_size + in_size_total > comms_mhu_msg_size - sizeof(uint32_t))
|
||||
|| (comms_embed_reply_min_size + out_size_total > comms_mhu_msg_size) - sizeof(uint32_t)) {
|
||||
if ((comms_embed_msg_min_size + in_size_total >
|
||||
comms_mhu_msg_size - sizeof(uint32_t)) ||
|
||||
(comms_embed_reply_min_size + out_size_total >
|
||||
comms_mhu_msg_size - sizeof(uint32_t))) {
|
||||
return RSS_COMMS_PROTOCOL_POINTER_ACCESS;
|
||||
} else {
|
||||
return RSS_COMMS_PROTOCOL_EMBED;
|
||||
|
|
Loading…
Add table
Reference in a new issue