aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Le Bayon <nicolas.le.bayon@st.com>2019-09-23 11:18:32 +0200
committerYann Gautier <yann.gautier@st.com>2020-10-13 11:27:40 +0200
commitd75a3409773973510e53742e27f31e82724f1158 (patch)
tree2eb9efa6c12bc95d004165c18dc3f7aa3db186ee
parent8ccf4954bf747099e999b111ab0c19cc7186b986 (diff)
downloadtrusted-firmware-a-d75a3409773973510e53742e27f31e82724f1158.tar.gz
stm32mp1: add asserts in get_cpu_package() and get_part_number()
Change-Id: I2b702698d6be93da5ac86da1cbc98b3838315a5a Signed-off-by: Nicolas Le Bayon <nicolas.le.bayon@st.com> Signed-off-by: Yann Gautier <yann.gautier@st.com>
-rw-r--r--plat/st/stm32mp1/stm32mp1_private.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/plat/st/stm32mp1/stm32mp1_private.c b/plat/st/stm32mp1/stm32mp1_private.c
index 29c4ad7ce9..e1df318292 100644
--- a/plat/st/stm32mp1/stm32mp1_private.c
+++ b/plat/st/stm32mp1/stm32mp1_private.c
@@ -154,6 +154,8 @@ static int get_part_number(uint32_t *part_nb)
uint32_t part_number;
uint32_t dev_id;
+ assert(part_nb != NULL);
+
if (stm32mp1_dbgmcu_get_chip_dev_id(&dev_id) < 0) {
return -1;
}
@@ -175,6 +177,8 @@ static int get_cpu_package(uint32_t *cpu_package)
{
uint32_t package;
+ assert(cpu_package != NULL);
+
if (bsec_shadow_read_otp(&package, PACKAGE_OTP) != BSEC_OK) {
ERROR("BSEC: PACKAGE_OTP Error\n");
return -1;