Make UUID buffer optional for is_trusted_os_present()
The caller might simply want to know whether there is a Trusted OS,
without the need to identify it.
Change-Id: I97eef8b6e6c4cb948d48735cd7170fced98aee9a
Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
diff --git a/lib/trusted_os/trusted_os.c b/lib/trusted_os/trusted_os.c
index b24c3d3..ac6a681 100644
--- a/lib/trusted_os/trusted_os.c
+++ b/lib/trusted_os/trusted_os.c
@@ -14,7 +14,6 @@
{
smc_args tos_uid_args = { SMC_TOS_UID };
smc_ret_values ret;
- uint32_t *tos_uuid32;
ret = tftf_smc(&tos_uid_args);
@@ -23,11 +22,13 @@
(ret.ret3 == 0)))
return 0;
- tos_uuid32 = (uint32_t *) tos_uuid;
- tos_uuid32[0] = ret.ret0;
- tos_uuid32[1] = ret.ret1;
- tos_uuid32[2] = ret.ret2;
- tos_uuid32[3] = ret.ret3;
+ if (tos_uuid != NULL) {
+ uint32_t *tos_uuid32 = (uint32_t *) tos_uuid;
+ tos_uuid32[0] = ret.ret0;
+ tos_uuid32[1] = ret.ret1;
+ tos_uuid32[2] = ret.ret2;
+ tos_uuid32[3] = ret.ret3;
+ }
return 1;
}