Skip to content

Commit 87cef59

Browse files
committed
flash/esp: Handle error codes returned by stub on BP set
1 parent b554f51 commit 87cef59

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/flash/nor/esp_flash.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1122,14 +1122,14 @@ int esp_algo_flash_breakpoint_add(struct target *target,
11221122
sw_bp->oocd_bp = NULL;
11231123
return ret;
11241124
}
1125-
if (run.ret_code == 0) {
1125+
if (run.ret_code <= 0) {
11261126
LOG_ERROR("%s: Failed to set bp (%" PRId32 ")!", target_name(target), run.ret_code);
11271127
destroy_mem_param(&mp);
11281128
sw_bp->oocd_bp = NULL;
11291129
return ERROR_FAIL;
11301130
}
11311131
sw_bp->insn_sz = (uint8_t)run.ret_code;
1132-
/* sanity check for instructionb buffer overflow */
1132+
/* sanity check for instruction buffer overflow */
11331133
assert(sw_bp->insn_sz <= sizeof(sw_bp->insn));
11341134
memcpy(sw_bp->insn, mp.value, sw_bp->insn_sz);
11351135
destroy_mem_param(&mp);

0 commit comments

Comments
 (0)