diff options
-rw-r--r-- | src/target/arm_adi_v5.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/target/arm_adi_v5.c b/src/target/arm_adi_v5.c index fd3a92ce..eed84ce9 100644 --- a/src/target/arm_adi_v5.c +++ b/src/target/arm_adi_v5.c @@ -1265,6 +1265,8 @@ int dap_lookup_cs_component(struct adiv5_dap *dap, int ap, retval = mem_ap_read_atomic_u32(dap, (component_base & 0xfffff000) | 0xfcc, &devtype); + if (retval != ERROR_OK) + return retval; if ((devtype & 0xff) == type) { *addr = component_base; retval = ERROR_OK; |