Re: [PATCH v1 16/16] dma-mapping: Disallow .map_sg operations from returning zero on error
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: Christoph Hellwig <hch@xxxxxx>
- Subject: Re: [PATCH v1 16/16] dma-mapping: Disallow .map_sg operations from returning zero on error
- From: Logan Gunthorpe <logang@xxxxxxxxxxxx>
- Date: Fri, 16 Jul 2021 10:17:58 -0600
- Cc: linux-kernel@xxxxxxxxxxxxxxx, linux-alpha@xxxxxxxxxxxxxxx, linux-arm-kernel@xxxxxxxxxxxxxxxxxxx, linux-ia64@xxxxxxxxxxxxxxx, linux-mips@xxxxxxxxxxxxxxx, linuxppc-dev@xxxxxxxxxxxxxxxx, linux-s390@xxxxxxxxxxxxxxx, sparclinux@xxxxxxxxxxxxxxx, iommu@xxxxxxxxxxxxxxxxxxxxxxxxxx, linux-parisc@xxxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, Marek Szyprowski <m.szyprowski@xxxxxxxxxxx>, Robin Murphy <robin.murphy@xxxxxxx>, Stephen Bates <sbates@xxxxxxxxxxxx>, Martin Oliveira <martin.oliveira@xxxxxxxxxxxxx>
- In-reply-to: <20210716063332.GD13345@lst.de>
- References: <20210715164544.6827-1-logang@deltatee.com> <20210715164544.6827-17-logang@deltatee.com> <20210716063332.GD13345@lst.de>
- User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0
On 2021-07-16 12:33 a.m., Christoph Hellwig wrote:
> On Thu, Jul 15, 2021 at 10:45:44AM -0600, Logan Gunthorpe wrote:
>> @@ -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
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]