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

Re: [PATCH v1 16/16] dma-mapping: Disallow .map_sg operations from returning zero on error

From: Logan Gunthorpe <logang@deltatee.com>
Date: 2021-07-16 16:18:16
Also in: linux-alpha, linux-arm-kernel, linux-iommu, linux-mips, linux-s390, lkml, sparclinux, xen-devel


On 2021-07-16 12:33 a.m., Christoph Hellwig wrote:
On Thu, Jul 15, 2021 at 10:45:44AM -0600, Logan Gunthorpe wrote:
quoted
@@ -194,6 +194,8 @@ static int __dma_map_sg_attrs(struct device *dev, struct scatterlist *sg,
 	else
 		ents = ops->map_sg(dev, sg, nents, dir, attrs);
 
+	WARN_ON_ONCE(ents == 0);
Turns this into a negative error code while we're at it, just to keep
the callers sane?
Sure thing. All the feedback makes sense, we'll fix it up and send a v2
in due course.

Thanks,

Logan
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help