[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210725060747.GA10852@lst.de>
Date: Sun, 25 Jul 2021 08:07:47 +0200
From: Christoph Hellwig <hch@....de>
To: Logan Gunthorpe <logang@...tatee.com>
Cc: linux-kernel@...r.kernel.org, linux-alpha@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-ia64@...r.kernel.org,
linux-mips@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
linux-s390@...r.kernel.org, sparclinux@...r.kernel.org,
iommu@...ts.linux-foundation.org, linux-parisc@...r.kernel.org,
xen-devel@...ts.xenproject.org, Christoph Hellwig <hch@....de>,
Marek Szyprowski <m.szyprowski@...sung.com>,
Robin Murphy <robin.murphy@....com>,
Stephen Bates <sbates@...thlin.com>,
Martin Oliveira <martin.oliveira@...eticom.com>
Subject: Re: [PATCH v2 01/21] dma-mapping: Allow map_sg() ops to return
negative error codes
> +int dma_map_sgtable(struct device *dev, struct sg_table *sgt,
> + enum dma_data_direction dir, unsigned long attrs)
> +{
> + int nents;
> +
> + nents = __dma_map_sg_attrs(dev, sgt->sgl, sgt->orig_nents, dir, attrs);
> + if (nents == 0)
> + return -EIO;
> + else if (nents < 0) {
> + if (WARN_ON_ONCE(nents != -EINVAL && nents != -ENOMEM &&
> + nents != -EIO))
> + return -EIO;
I think this validation of the errnos needs to go into __dma_map_sg_attrs,
so that we catch it for the classic dma_map_sg callers as well.
Powered by blists - more mailing lists