]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
swiotlb: fix inversed DMA_ATTR_NO_WARN test
authorMichel Dänzer <michel.daenzer@amd.com>
Tue, 1 May 2018 13:24:11 +0000 (15:24 +0200)
committerChristoph Hellwig <hch@lst.de>
Wed, 2 May 2018 12:48:55 +0000 (14:48 +0200)
The result was printing the warning only when we were explicitly asked
not to.

Cc: stable@vger.kernel.org
Fixes: 0176adb004065d6815a8e67946752df4cd947c5b "swiotlb: refactor
 coherent buffer allocation"
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>.
Signed-off-by: Christoph Hellwig <hch@lst.de>
lib/swiotlb.c

index fece57566d45b24454b9cb766d4eecd652031ab2..12fbaa4456375a4078eae581e46ad6e73ed0e139 100644 (file)
@@ -737,7 +737,7 @@ swiotlb_alloc_buffer(struct device *dev, size_t size, dma_addr_t *dma_handle,
        swiotlb_tbl_unmap_single(dev, phys_addr, size, DMA_TO_DEVICE,
                        DMA_ATTR_SKIP_CPU_SYNC);
 out_warn:
-       if ((attrs & DMA_ATTR_NO_WARN) && printk_ratelimit()) {
+       if (!(attrs & DMA_ATTR_NO_WARN) && printk_ratelimit()) {
                dev_warn(dev,
                        "swiotlb: coherent allocation failed, size=%zu\n",
                        size);