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 committed Sep 26, 2024
1 parent 7b98f66 commit 986e3ef
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 986e3ef

Please sign in to comment.