aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Vanek <vanekt@fbl.cz>2019-01-19 15:58:49 +0100
committerMatthias Welwarsky <matthias@welwarsky.de>2019-01-23 15:25:53 +0000
commit418515b21ed506449dfc9981265edec7800619b5 (patch)
treed7c33b2a7ee0ecaac1983b3a4d931c2b283a6275
parent8896abbf07b11869018889ed672f05cf61295aaf (diff)
downloadriscv-openocd-418515b21ed506449dfc9981265edec7800619b5.zip
riscv-openocd-418515b21ed506449dfc9981265edec7800619b5.tar.gz
riscv-openocd-418515b21ed506449dfc9981265edec7800619b5.tar.bz2
target/arm_dap: fix segmentation fault in 'dap info' cmd
'dap info' command fails hard on a hla target. Change-Id: Ia188b1afe527e0ed64512d1bddadd507f978e40b Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/4860 Tested-by: jenkins Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
-rw-r--r--src/target/arm_dap.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/target/arm_dap.c b/src/target/arm_dap.c
index 3adb4ed..119e511 100644
--- a/src/target/arm_dap.c
+++ b/src/target/arm_dap.c
@@ -313,6 +313,11 @@ COMMAND_HANDLER(handle_dap_info_command)
struct adiv5_dap *dap = arm->dap;
uint32_t apsel;
+ if (dap == NULL) {
+ LOG_ERROR("DAP instance not available. Probably a HLA target...");
+ return ERROR_TARGET_RESOURCE_NOT_AVAILABLE;
+ }
+
switch (CMD_ARGC) {
case 0:
apsel = dap->apsel;