diff options
author | Haoran.Wang <elven.wang@nxp.com> | 2018-09-11 19:59:29 +0800 |
---|---|---|
committer | Haoran.Wang <elven.wang@nxp.com> | 2018-09-12 18:12:13 +0800 |
commit | ccdad98f9c57d853a0767281a6cc165c731ee5fa (patch) | |
tree | 1f54ecee5ce8b23f77ad47795c67d4ef0a2eb679 /lib | |
parent | bd75cb6eba847d256ad320ca2cfd7dae414ae32a (diff) |
MA-11015-2 Don't access tipc before keymaster init
This patch fix the bug that when keymaster tipc not
initialized the access will make uboot panic.
Change-Id: I6500219061ce69103c5f98750eaa5ace4854efea
Signed-off-by: Haoran.Wang <elven.wang@nxp.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/trusty/ql-tipc/keymaster.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/trusty/ql-tipc/keymaster.c b/lib/trusty/ql-tipc/keymaster.c index e0b8217262..2c241018b7 100644 --- a/lib/trusty/ql-tipc/keymaster.c +++ b/lib/trusty/ql-tipc/keymaster.c @@ -31,7 +31,7 @@ #define LOCAL_LOG 0 static struct trusty_ipc_chan km_chan; -static bool initialized; +static bool initialized = false; static int trusty_km_version = 2; static const size_t kMaxCaRequestSize = 10000; static const size_t kMaxSendSize = 4000; @@ -321,6 +321,10 @@ int trusty_set_boot_params(uint32_t os_version, uint32_t os_patchlevel, const uint8_t *verified_boot_hash, uint32_t verified_boot_hash_size) { + if (!initialized) { + trusty_error("Keymaster TIPC client not initialized!\n"); + return -1; + } struct km_boot_params params = { .os_version = os_version, .os_patchlevel = os_patchlevel, |