summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSandrine Bailleux <sandrine.bailleux@arm.com>2019-01-07 09:53:50 +0100
committerSandrine Bailleux <sandrine.bailleux@arm.com>2019-01-07 12:53:44 +0100
commitcab5e3693738743255bd9a8a8f36dccdd74ca495 (patch)
treef101603c56eeb05773923aa8d84a4a0603c3b5c7 /lib
parentbbdb2762062547ef279256d0163e4d743f21474a (diff)
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>
Diffstat (limited to 'lib')
-rw-r--r--lib/trusted_os/trusted_os.c13
1 files changed, 7 insertions, 6 deletions
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 @@ unsigned int is_trusted_os_present(uuid_t *tos_uuid)
{
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 @@ unsigned int is_trusted_os_present(uuid_t *tos_uuid)
(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;
}