aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dma-debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/dma-debug.c')
-rw-r--r--lib/dma-debug.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/dma-debug.c b/lib/dma-debug.c
index 1b34d210452c..7f5cdc1e6b29 100644
--- a/lib/dma-debug.c
+++ b/lib/dma-debug.c
@@ -1491,12 +1491,12 @@ void debug_dma_alloc_coherent(struct device *dev, size_t size,
1491 if (unlikely(virt == NULL)) 1491 if (unlikely(virt == NULL))
1492 return; 1492 return;
1493 1493
1494 entry = dma_entry_alloc(); 1494 /* handle vmalloc and linear addresses */
1495 if (!entry) 1495 if (!is_vmalloc_addr(virt) && !virt_addr_valid(virt))
1496 return; 1496 return;
1497 1497
1498 /* handle vmalloc and linear addresses */ 1498 entry = dma_entry_alloc();
1499 if (!is_vmalloc_addr(virt) && !virt_to_page(virt)) 1499 if (!entry)
1500 return; 1500 return;
1501 1501
1502 entry->type = dma_debug_coherent; 1502 entry->type = dma_debug_coherent;
@@ -1528,7 +1528,7 @@ void debug_dma_free_coherent(struct device *dev, size_t size,
1528 }; 1528 };
1529 1529
1530 /* handle vmalloc and linear addresses */ 1530 /* handle vmalloc and linear addresses */
1531 if (!is_vmalloc_addr(virt) && !virt_to_page(virt)) 1531 if (!is_vmalloc_addr(virt) && !virt_addr_valid(virt))
1532 return; 1532 return;
1533 1533
1534 if (is_vmalloc_addr(virt)) 1534 if (is_vmalloc_addr(virt))