]> git.baikalelectronics.ru Git - arm-tf.git/commitdiff
stm32mp1: add asserts in get_cpu_package() and get_part_number()
authorNicolas Le Bayon <nicolas.le.bayon@st.com>
Mon, 23 Sep 2019 09:18:32 +0000 (11:18 +0200)
committerYann Gautier <yann.gautier@st.com>
Tue, 13 Oct 2020 09:27:40 +0000 (11:27 +0200)
Change-Id: I2b702698d6be93da5ac86da1cbc98b3838315a5a
Signed-off-by: Nicolas Le Bayon <nicolas.le.bayon@st.com>
Signed-off-by: Yann Gautier <yann.gautier@st.com>
plat/st/stm32mp1/stm32mp1_private.c

index 29c4ad7ce9268eb0c5d1c0d5538c4555d8960734..e1df31829264b58dee130b454265884929a56182 100644 (file)
@@ -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;