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

Commit c92c8db7 authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "arm64: mm: dma-mapping: Add additional error checking"

parents f5e53f17 19f729f8
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -1114,6 +1114,11 @@ static void arm_iommu_get_dma_window(struct device *dev, u64 *dma_addr,
			naddr + nsize);
		return;
	}
	if (naddr == 0 || nsize == 0) {
		dev_err(dev, "Invalid #address-cells %d or #size-cells %d\n",
			naddr, nsize);
		return;
	}

	*dma_addr = of_read_number(ranges, naddr);
	*dma_size = of_read_number(ranges + naddr, nsize);
@@ -1238,6 +1243,11 @@ int __depr_arm_iommu_attach_device(struct device *dev,
	struct iommu_domain *domain;
	struct iommu_group *group = dev->iommu_group;

	if (!dev || !mapping) {
		pr_err("%s: Error input is NULL\n", __func__);
		return -EINVAL;
	}

	if (!group) {
		dev_err(dev, "No iommu associated with device\n");
		return -EINVAL;