Skip to content

Commit

Permalink
jtagtap: Protect tdi_tdo_seq from writing into NULL data_out
Browse files Browse the repository at this point in the history
...by redirecting to faster tdi_seq
* Do not use nullability attributes yet
  • Loading branch information
ALTracer committed Dec 31, 2023
1 parent 3a29354 commit 893138b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/platforms/common/jtagtap.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,9 @@ static void jtagtap_tdi_tdo_seq_no_delay(
static void jtagtap_tdi_tdo_seq(
uint8_t *const data_out, const bool final_tms, const uint8_t *const data_in, size_t clock_cycles)
{
/* In case the callsite passes NULL for data_out, don't bother sampling TDO */
if (!data_out)
return jtagtap_tdi_seq(final_tms, data_in, clock_cycles);
gpio_clear(TMS_PORT, TMS_PIN);
gpio_clear(TDI_PORT, TDI_PIN);
if (target_clk_divider != UINT32_MAX)
Expand Down

0 comments on commit 893138b

Please sign in to comment.