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 Jan 4, 2024
1 parent d425df2 commit 58a2425
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 58a2425

Please sign in to comment.