From 8829f38bee751386c9c968591ae88f2438ec9d0c Mon Sep 17 00:00:00 2001 From: zhangkai25 Date: Mon, 5 Aug 2024 09:58:16 +0800 Subject: [PATCH] Initialize af_channel to ensure no out-of-bounds situations occur Signed-off-by: zhangkai25 --- drivers/analog/adc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/analog/adc.c b/drivers/analog/adc.c index 85b14c5948bf5..37ef9be1f291e 100644 --- a/drivers/analog/adc.c +++ b/drivers/analog/adc.c @@ -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; }