Initialize af_channel to ensure no out-of-bounds situations occur

Signed-off-by: zhangkai25 <zhangkai25@xiaomi.com>
This commit is contained in:
zhangkai25 2024-08-05 09:58:16 +08:00 committed by Xiang Xiao
parent 63249f71d1
commit 8829f38bee

View file

@ -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;
}