drivers/dma: stm32 fix dmamux request id valid check
The request id is given by the DMA request MUX id which start at offset 1 and are vaid until req_nb + gen_nb. Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
This commit is contained in:
parent
3c87b7acaa
commit
04ee034f4b
1 changed files with 3 additions and 2 deletions
|
@ -94,8 +94,9 @@ int dmamux_stm32_configure(const struct device *dev, uint32_t id,
|
||||||
*/
|
*/
|
||||||
int request_id = config->dma_slot;
|
int request_id = config->dma_slot;
|
||||||
|
|
||||||
if (request_id >= dev_config->req_nb + dev_config->gen_nb) {
|
if (request_id == 0 ||
|
||||||
LOG_ERR("request ID %d is too big.", request_id);
|
request_id > dev_config->req_nb + dev_config->gen_nb) {
|
||||||
|
LOG_ERR("request ID %d is not valid.", request_id);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue