Commit d75a3409 authored by Nicolas Le Bayon's avatar Nicolas Le Bayon Committed by Yann Gautier
Browse files

stm32mp1: add asserts in get_cpu_package() and get_part_number()



Change-Id: I2b702698d6be93da5ac86da1cbc98b3838315a5a
Signed-off-by: default avatarNicolas Le Bayon <nicolas.le.bayon@st.com>
Signed-off-by: default avatarYann Gautier <yann.gautier@st.com>
parent 8ccf4954
...@@ -154,6 +154,8 @@ static int get_part_number(uint32_t *part_nb) ...@@ -154,6 +154,8 @@ static int get_part_number(uint32_t *part_nb)
uint32_t part_number; uint32_t part_number;
uint32_t dev_id; uint32_t dev_id;
assert(part_nb != NULL);
if (stm32mp1_dbgmcu_get_chip_dev_id(&dev_id) < 0) { if (stm32mp1_dbgmcu_get_chip_dev_id(&dev_id) < 0) {
return -1; return -1;
} }
...@@ -175,6 +177,8 @@ static int get_cpu_package(uint32_t *cpu_package) ...@@ -175,6 +177,8 @@ static int get_cpu_package(uint32_t *cpu_package)
{ {
uint32_t package; uint32_t package;
assert(cpu_package != NULL);
if (bsec_shadow_read_otp(&package, PACKAGE_OTP) != BSEC_OK) { if (bsec_shadow_read_otp(&package, PACKAGE_OTP) != BSEC_OK) {
ERROR("BSEC: PACKAGE_OTP Error\n"); ERROR("BSEC: PACKAGE_OTP Error\n");
return -1; return -1;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment