diff options
Diffstat (limited to 'lib/swiotlb.c')
-rw-r--r-- | lib/swiotlb.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/swiotlb.c b/lib/swiotlb.c index f8eebd489149..78330c37a61b 100644 --- a/lib/swiotlb.c +++ b/lib/swiotlb.c | |||
@@ -497,8 +497,10 @@ swiotlb_alloc_coherent(struct device *hwdev, size_t size, | |||
497 | printk("hwdev DMA mask = 0x%016Lx, dev_addr = 0x%016Lx\n", | 497 | printk("hwdev DMA mask = 0x%016Lx, dev_addr = 0x%016Lx\n", |
498 | (unsigned long long)*hwdev->dma_mask, | 498 | (unsigned long long)*hwdev->dma_mask, |
499 | (unsigned long long)dev_addr); | 499 | (unsigned long long)dev_addr); |
500 | panic("swiotlb_alloc_coherent: allocated memory is out of " | 500 | |
501 | "range for device"); | 501 | /* DMA_TO_DEVICE to avoid memcpy in unmap_single */ |
502 | unmap_single(hwdev, ret, size, DMA_TO_DEVICE); | ||
503 | return NULL; | ||
502 | } | 504 | } |
503 | *dma_handle = dev_addr; | 505 | *dma_handle = dev_addr; |
504 | return ret; | 506 | return ret; |