drivers: dma: fix off-by-one error in silabs LDMA

Channel numbers are 0-based so a channel number equal to the number of
channels is invalid.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
This commit is contained in:
Benjamin Cabé 2025-06-16 11:41:53 +02:00 committed by Daniel DeGrasse
commit bc03f23d50

View file

@ -329,7 +329,7 @@ static int dma_silabs_configure(const struct device *dev, uint32_t channel,
LDMA_TransferCfg_t *xfer_config = &chan_conf->xfer_config;
int ret;
if (channel > data->dma_ctx.dma_channels) {
if (channel >= data->dma_ctx.dma_channels) {
return -EINVAL;
}