Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0c89179c authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "dma-mapping: Check for valid IOVA address"

parents 52568f64 619fe082
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1697,6 +1697,12 @@ int arm_iommu_map_sg(struct device *dev, struct scatterlist *sg,
		total_length += s->length;

	iova = __alloc_iova(mapping, total_length);

	if (iova == DMA_ERROR_CODE) {
		dev_err(dev, "Couldn't allocate iova for sg %p\n", sg);
		return 0;
	}

	ret = iommu_map_sg(mapping->domain, iova, sg, nents, prot);
	if (ret != total_length) {
		__free_iova(mapping, iova, total_length);