Skip to contentSkip to conversation

PCI: qcom: Fix using uninitialized smmu_sid_base variable

PATCH RESEND New Manivannan Sadhasivam 1 participant 1 message Dec 9, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 PCI: qcom: Fix using uninitialized smmu_sid_base variable

From: Manivannan Sadhasivam <[email protected]>

smmu_sid_base should hold the base of SMMU SID extracted from the first entry of iommu-map. This value will be used to extract the successive SMMU SID values. Fix it by assigning the first SMMU SID base before for loop.

---
 drivers/pci/controller/dwc/pcie-qcom.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/pci/controller/dwc/pcie-qcom.c +3 -0
index 8ba3e6b29196..affa2713bf80 100644
@@ -1297,6 +1297,9 @@ static int qcom_pcie_config_sid_sm8250(struct qcom_pcie *pcie)
 	/* Registers need to be zero out first */
 	memset_io(bdf_to_sid_base, 0, CRC8_TABLE_SIZE * sizeof(u32));
 
+	/* Extract the SMMU SID base from the first entry of iommu-map */
+	smmu_sid_base = map[0].smmu_sid;
+
 	/* Look for an available entry to hold the mapping */
 	for (i = 0; i < nr_map; i++) {
 		u16 bdf_be = cpu_to_be16(map[i].bdf);
Signature · 1 line
2.25.1