Thread (28 messages) 28 messages, 6 authors, 2021-07-19

Re: [PATCH v1 14/16] x86/amd_gart: return error code from gart_map_sg()

From: Robin Murphy <robin.murphy@arm.com>
Date: 2021-07-16 12:11:47
Also in: linux-alpha, linux-iommu, linux-mips, linux-s390, linuxppc-dev, lkml, sparclinux, xen-devel

On 2021-07-16 07:32, Christoph Hellwig wrote:
On Thu, Jul 15, 2021 at 10:45:42AM -0600, Logan Gunthorpe wrote:
quoted
@@ -458,7 +460,7 @@ static int gart_map_sg(struct device *dev, struct scatterlist *sg, int nents,
  	iommu_full(dev, pages << PAGE_SHIFT, dir);
  	for_each_sg(sg, s, nents, i)
  		s->dma_address = DMA_MAPPING_ERROR;
-	return 0;
+	return ret;
While we're at it - setting the ->dma_address to DMA_MAPPING_ERROR is
not part of the ->map_sg calling convention.  Might be worth to fix
up while we're at it.
Especially since it's not even zeroing dma_length, which at least is a 
documented indicator of validity (even if it's not strictly defined for 
failure cases either).

Robin.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help