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:
parent
2027d97dac
commit
bc03f23d50
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue