Initialize af_channel to ensure no out-of-bounds situations occur
Signed-off-by: zhangkai25 <zhangkai25@xiaomi.com>
This commit is contained in:
parent
63249f71d1
commit
8829f38bee
1 changed files with 1 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue