target: catch dap_lookup read error
Issue found by clang-3.1 Change-Id: I2e922ec83117e75db5bec1e82edaa75a9e6e7464 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/778 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>__archive__
parent
640141eea3
commit
78f4f95648
|
@ -1265,6 +1265,8 @@ int dap_lookup_cs_component(struct adiv5_dap *dap, int ap,
|
||||||
retval = mem_ap_read_atomic_u32(dap,
|
retval = mem_ap_read_atomic_u32(dap,
|
||||||
(component_base & 0xfffff000) | 0xfcc,
|
(component_base & 0xfffff000) | 0xfcc,
|
||||||
&devtype);
|
&devtype);
|
||||||
|
if (retval != ERROR_OK)
|
||||||
|
return retval;
|
||||||
if ((devtype & 0xff) == type) {
|
if ((devtype & 0xff) == type) {
|
||||||
*addr = component_base;
|
*addr = component_base;
|
||||||
retval = ERROR_OK;
|
retval = ERROR_OK;
|
||||||
|
|
Loading…
Reference in New Issue