|
From: openocd-gerrit <ope...@us...> - 2024-05-04 08:34:25
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Main OpenOCD repository".
The branch, master has been updated
via 89d881c19ae89712652f17962b8b7d2e79e25ca3 (commit)
from 8667a726532604afab099881779a4b898539dabf (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 89d881c19ae89712652f17962b8b7d2e79e25ca3
Author: Antonio Borneo <bor...@gm...>
Date: Mon Apr 8 17:40:09 2024 +0200
cortex_m: don't try to halt not-examined targets
Prevent a segmentation fault by preventing to try to halt a target
that has not been examined yet.
Change-Id: I5d344e7fbdb5422f7c5e2c39bdd48cbc6c2a3e58
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/8213
Tested-by: jenkins
diff --git a/src/target/cortex_m.c b/src/target/cortex_m.c
index a26df2e5a..c225b1aa9 100644
--- a/src/target/cortex_m.c
+++ b/src/target/cortex_m.c
@@ -1109,6 +1109,11 @@ static int cortex_m_halt_one(struct target *target)
int retval;
LOG_TARGET_DEBUG(target, "target->state: %s", target_state_name(target));
+ if (!target_was_examined(target)) {
+ LOG_TARGET_ERROR(target, "target non examined yet");
+ return ERROR_TARGET_NOT_EXAMINED;
+ }
+
if (target->state == TARGET_HALTED) {
LOG_TARGET_DEBUG(target, "target was already halted");
return ERROR_OK;
-----------------------------------------------------------------------
Summary of changes:
src/target/cortex_m.c | 5 +++++
1 file changed, 5 insertions(+)
hooks/post-receive
--
Main OpenOCD repository
|