diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/swiotlb.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/swiotlb.c b/lib/swiotlb.c index 9e2fe3e1804c..ac25cd28e807 100644 --- a/lib/swiotlb.c +++ b/lib/swiotlb.c | |||
@@ -581,12 +581,15 @@ swiotlb_full(struct device *dev, size_t size, int dir, int do_panic) | |||
581 | printk(KERN_ERR "DMA: Out of SW-IOMMU space for %zu bytes at " | 581 | printk(KERN_ERR "DMA: Out of SW-IOMMU space for %zu bytes at " |
582 | "device %s\n", size, dev ? dev_name(dev) : "?"); | 582 | "device %s\n", size, dev ? dev_name(dev) : "?"); |
583 | 583 | ||
584 | if (size > io_tlb_overflow && do_panic) { | 584 | if (size <= io_tlb_overflow || !do_panic) |
585 | if (dir == DMA_FROM_DEVICE || dir == DMA_BIDIRECTIONAL) | 585 | return; |
586 | panic("DMA: Memory would be corrupted\n"); | 586 | |
587 | if (dir == DMA_TO_DEVICE || dir == DMA_BIDIRECTIONAL) | 587 | if (dir == DMA_BIDIRECTIONAL) |
588 | panic("DMA: Random memory would be DMAed\n"); | 588 | panic("DMA: Random memory could be DMA accessed\n"); |
589 | } | 589 | if (dir == DMA_FROM_DEVICE) |
590 | panic("DMA: Random memory could be DMA written\n"); | ||
591 | if (dir == DMA_TO_DEVICE) | ||
592 | panic("DMA: Random memory could be DMA read\n"); | ||
590 | } | 593 | } |
591 | 594 | ||
592 | /* | 595 | /* |