Skip to content

Commit 8829f38

Browse files
zhangkai25xiaoxiang781216
authored andcommitted
Initialize af_channel to ensure no out-of-bounds situations occur
Signed-off-by: zhangkai25 <[email protected]>
1 parent 63249f7 commit 8829f38

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/analog/adc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,7 @@ int adc_register(FAR const char *path, FAR struct adc_dev_s *dev)
767767

768768
/* Initialize the af_channale */
769769

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

772772
return ret;
773773
}

0 commit comments

Comments
 (0)