Skip to content

Commit bc03f23

Browse files
kartbendanieldegrasse
authored andcommitted
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>
1 parent 2027d97 commit bc03f23

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/dma/dma_silabs_ldma.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ static int dma_silabs_configure(const struct device *dev, uint32_t channel,
329329
LDMA_TransferCfg_t *xfer_config = &chan_conf->xfer_config;
330330
int ret;
331331

332-
if (channel > data->dma_ctx.dma_channels) {
332+
if (channel >= data->dma_ctx.dma_channels) {
333333
return -EINVAL;
334334
}
335335

0 commit comments

Comments
 (0)