Commit 3661b4f58accb970ae367c73b49786a2a13e3cdf

Authored by BJ DevOps Team
Exists in emb_lf_v2022.04

Merge remote-tracking branch 'origin/imx_v2022.04' into lf_v2022.04

* origin/imx_v2022.04:
  MA-20507-7 trusty: fix dereference null return value

Showing 1 changed file Side-by-side Diff

lib/trusty/ql-tipc/keymaster.c
... ... @@ -690,6 +690,11 @@
690 690 int rc;
691 691  
692 692 req = trusty_calloc(4, 1); // 4 bytes should be enough.
  693 + if (!req) {
  694 + trusty_error("trusty_calloc memory failed!\n");
  695 + return -1;
  696 + }
  697 +
693 698 memcpy(req, &boot_patch_level, sizeof(uint32_t));
694 699 req_size = sizeof(uint32_t);
695 700