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

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

Merge "cnss2: Avoid change to avoid null pointer dereference"

parents 0caad3ca ce5ce205
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -3032,8 +3032,11 @@ int cnss_smmu_map(struct device *dev,
	if (!test_bit(DISABLE_IO_COHERENCY,
		      &plat_priv->ctrl_params.quirks)) {
		root_port = pci_find_pcie_root_port(pci_priv->pci_dev);
		if (!root_port) {
			cnss_pr_err("Root port is null, so dma_coherent is disabled\n");
		} else {
			root_of_node = root_port->dev.of_node;
		if (root_of_node->parent) {
			if (root_of_node && root_of_node->parent) {
				dma_coherent =
				    of_property_read_bool(root_of_node->parent,
							  "dma-coherent");
@@ -3043,6 +3046,7 @@ int cnss_smmu_map(struct device *dev,
				flag |= IOMMU_CACHE;
			}
		}
	}

	ret = iommu_map(pci_priv->iommu_domain, iova,
			rounddown(paddr, PAGE_SIZE), len, flag);