Skip to content

Commit 8f39277

Browse files
GuEe-GUIRbb666
authored andcommitted
[DM/DMA] Use strict mode for device DMA pool
Signed-off-by: GuEe-GUI <[email protected]>
1 parent 61779ef commit 8f39277

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

components/drivers/dma/dma_pool.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,8 +322,14 @@ static void *dma_alloc(struct rt_device *dev, rt_size_t size,
322322

323323
rt_list_for_each_entry(pool, &dma_pool_nodes, list)
324324
{
325-
if ((flags & RT_DMA_F_DEVICE) &&
326-
(!(pool->flags & RT_DMA_F_DEVICE) || pool->dev != dev))
325+
if (pool->flags & RT_DMA_F_DEVICE)
326+
{
327+
if (!(flags & RT_DMA_F_DEVICE) || pool->dev != dev)
328+
{
329+
continue;
330+
}
331+
}
332+
else if ((flags & RT_DMA_F_DEVICE))
327333
{
328334
continue;
329335
}

0 commit comments

Comments
 (0)