This is an automated email from Gerrit.

"Michael Schwingen <[email protected]>" just uploaded a new 
patch set to Gerrit, which you can find at 
https://review.openocd.org/c/openocd/+/6545

-- gerrit

commit d3177be64ff82d71248a32c8bdd5349ee75758e3
Author: Michael Schwingen <[email protected]>
Date:   Sun Sep 5 20:15:00 2021 +0200

    fix crash in case cortex_m->core_info is not set
    
    Signed-off-by: Michael Schwingen <[email protected]>
    Change-Id: I812ee7fee17b3d0f25c1f8661cceb15f2cc719cf

diff --git a/src/flash/nor/stm32f1x.c b/src/flash/nor/stm32f1x.c
index 669761472..ae20d5f9a 100644
--- a/src/flash/nor/stm32f1x.c
+++ b/src/flash/nor/stm32f1x.c
@@ -640,6 +640,8 @@ static int stm32x_detect(struct flash_bank *bank)
                return ERROR_FAIL;
        }
 
+       if (!cortex_m->core_info)
+               return ERROR_FAIL;
        switch (cortex_m->core_info->partno) {
        case CORTEX_M0_PARTNO: /* STM32F0x devices */
                stm32x_info->device_id_reg = 0x40015800;
@@ -672,6 +674,8 @@ static int gd32_detect(struct flash_bank *bank)
                return ERROR_FAIL;
        }
 
+       if (!cortex_m->core_info)
+               return ERROR_FAIL;
        switch (cortex_m->core_info->partno) {
        case CORTEX_M3_PARTNO:
                stm32x_info->device_id_reg = 0xE0042000;

-- 

Reply via email to