Skip to content

Commit

Permalink
Initialize af_channel to ensure no out-of-bounds situations occur
Browse files Browse the repository at this point in the history
Signed-off-by: zhangkai25 <[email protected]>
  • Loading branch information
zhangkai25 authored and xiaoxiang781216 committed Sep 27, 2024
1 parent 63249f7 commit 8829f38
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/analog/adc.c
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,7 @@ int adc_register(FAR const char *path, FAR struct adc_dev_s *dev)

/* Initialize the af_channale */

memset(&fifo->af_channel[fifo->af_tail], 0, CONFIG_ADC_FIFOSIZE);
memset(&fifo->af_channel[0], 0, CONFIG_ADC_FIFOSIZE);

return ret;
}

0 comments on commit 8829f38

Please sign in to comment.