fix: not null uuid then return should be null
If the caller to FFA_PARTITION_INFO_GET provided
an UUID, then the returned UUID in the info descriptor
MBZ.
The `api_ffa_fill_partition_info` was not zeroing the
field, which it meant the previously used UUID
was being copied.
Signed-off-by: J-Alves <joao.alves@arm.com>
Change-Id: I210f2097300ca79770531db0a6963140c2b33760
diff --git a/src/api.c b/src/api.c
index c5c40b3..9ce1964 100644
--- a/src/api.c
+++ b/src/api.c
@@ -573,7 +573,7 @@
* If the number of entries surpasses the size
* of `out_partitions`
*/
- if (*entries_count > out_partitions_len) {
+ if (*entries_count >= out_partitions_len) {
return false;
}
@@ -585,8 +585,15 @@
api_ffa_fill_partition_info(out_partition, vm,
caller_id);
+ /*
+ * If the ABI has specified an UUID, then do not
+ * write it
+ */
if (match_any) {
out_partition->uuid = uuid;
+ } else {
+ out_partition->uuid =
+ (struct ffa_uuid){0};
}
/*