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>
This commit is contained in:
Haoran.Wang 2018-09-11 19:59:29 +08:00
parent bd75cb6eba
commit ccdad98f9c
1 changed files with 5 additions and 1 deletions

View File

@ -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,