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.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/dma-debug.c b/lib/dma-debug.c
index f9e6d38b4b34..1a992089486c 100644
--- a/lib/dma-debug.c
+++ b/lib/dma-debug.c
@@ -722,10 +722,11 @@ void debug_dma_map_page(struct device *dev, struct page *page, size_t offset,
722 entry->size = size; 722 entry->size = size;
723 entry->direction = direction; 723 entry->direction = direction;
724 724
725 if (map_single) { 725 if (map_single)
726 void *addr = ((char *)page_address(page)) + offset;
727
728 entry->type = dma_debug_single; 726 entry->type = dma_debug_single;
727
728 if (!PageHighMem(page)) {
729 void *addr = ((char *)page_address(page)) + offset;
729 check_for_stack(dev, addr); 730 check_for_stack(dev, addr);
730 check_for_illegal_area(dev, addr, size); 731 check_for_illegal_area(dev, addr, size);
731 } 732 }
@@ -779,8 +780,10 @@ void debug_dma_map_sg(struct device *dev, struct scatterlist *sg,
779 entry->sg_call_ents = nents; 780 entry->sg_call_ents = nents;
780 entry->sg_mapped_ents = mapped_ents; 781 entry->sg_mapped_ents = mapped_ents;
781 782
782 check_for_stack(dev, sg_virt(s)); 783 if (!PageHighMem(sg_page(s))) {
783 check_for_illegal_area(dev, sg_virt(s), s->length); 784 check_for_stack(dev, sg_virt(s));
785 check_for_illegal_area(dev, sg_virt(s), s->length);
786 }
784 787
785 add_dma_entry(entry); 788 add_dma_entry(entry);
786 } 789 }