Explorar o código

swiotlb: fix inversed DMA_ATTR_NO_WARN test

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>
Michel Dänzer %!s(int64=7) %!d(string=hai) anos
pai
achega
892a0be43e
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      lib/swiotlb.c

+ 1 - 1
lib/swiotlb.c

@@ -737,7 +737,7 @@ out_unmap:
 	swiotlb_tbl_unmap_single(dev, phys_addr, size, DMA_TO_DEVICE,
 	swiotlb_tbl_unmap_single(dev, phys_addr, size, DMA_TO_DEVICE,
 			DMA_ATTR_SKIP_CPU_SYNC);
 			DMA_ATTR_SKIP_CPU_SYNC);
 out_warn:
 out_warn:
-	if ((attrs & DMA_ATTR_NO_WARN) && printk_ratelimit()) {
+	if (!(attrs & DMA_ATTR_NO_WARN) && printk_ratelimit()) {
 		dev_warn(dev,
 		dev_warn(dev,
 			"swiotlb: coherent allocation failed, size=%zu\n",
 			"swiotlb: coherent allocation failed, size=%zu\n",
 			size);
 			size);