Skip to contentSkip to conversation

pci: dwc: Fix NULL pointer dereference due to missing assignment

PATCH In review Vivek Gautam 2 participants 3 messages Feb 28, 2017 – Mar 2, 2017 PCI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pci: dwc: Fix NULL pointer dereference due to missing assignment

Add missing assignment of dw_pci core structure for designware-plat.

Commit 8b130f815a6b ("PCI: dwc: Fix crashes seen due to missing assignments") fixed all other platforms, but missed designware-plat file.

Fixes 442ec4c04d12 ("PCI: dwc: all: Split struct pcie_port into host-only and core structures")
Cc Guenter Roeck <[email protected]>
Cc Bjorn Helgaas <[email protected]>
Cc Kishon Vijay Abraham I <[email protected]>
Cc Jingoo Han <[email protected]>
Cc Joao Pinto <[email protected]>

---

Based on torvald's master branch.
Build tested.

 drivers/pci/dwc/pcie-designware-plat.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/pci/dwc/pcie-designware-plat.c +2 -0
index 65250f63515c..b6c832ba39dd 100644
@@ -104,6 +104,8 @@ static int dw_plat_pcie_probe(struct platform_device *pdev)
 
 	pci->dev = dev;
 
+	dw_plat_pcie->pci = pci;
+
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	pci->dbi_base = devm_ioremap_resource(dev, res);
 	if (IS_ERR(pci->dbi_base))
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
#1 lore raw
Quoted 9 lines · Vivek Gautam

Add missing assignment of dw_pci core structure for designware-plat.

Commit 8b130f815a6b ("PCI: dwc: Fix crashes seen due to missing assignments") fixed all other platforms, but missed designware-plat file.

Fixes 442ec4c04d12 ("PCI: dwc: all: Split struct pcie_port into host-only and core structures")
Quoted 8 lines
Cc Guenter Roeck <[email protected]>
Cc Bjorn Helgaas <[email protected]>
Cc Kishon Vijay Abraham I <[email protected]>
Cc Jingoo Han <[email protected]>
Cc Joao Pinto <[email protected]>

Thanks, Vivek! I folded this into Guenter's patch and added your Signed-off-by for this designware-plat fix. I'll ask Linus to pull this before v4.11-rc1.

Quoted 25 lines

---

Based on torvald's master branch.
Build tested.

 drivers/pci/dwc/pcie-designware-plat.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/pci/dwc/pcie-designware-plat.c +2 -0
index 65250f63515c..b6c832ba39dd 100644
@@ -104,6 +104,8 @@ static int dw_plat_pcie_probe(struct platform_device *pdev)
 
 	pci->dev = dev;
 
+	dw_plat_pcie->pci = pci;
+
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	pci->dbi_base = devm_ioremap_resource(dev, res);
 	if (IS_ERR(pci->dbi_base))
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
#2 lore raw
Quoted 18 lines · Bjorn Helgaas
Quoted 9 lines · Vivek Gautam

Add missing assignment of dw_pci core structure for designware-plat.

Commit 8b130f815a6b ("PCI: dwc: Fix crashes seen due to missing assignments") fixed all other platforms, but missed designware-plat file.

Fixes 442ec4c04d12 ("PCI: dwc: all: Split struct pcie_port into host-only and core structures")
Quoted 8 lines
Cc Guenter Roeck <[email protected]>
Cc Bjorn Helgaas <[email protected]>
Cc Kishon Vijay Abraham I <[email protected]>
Cc Jingoo Han <[email protected]>
Cc Joao Pinto <[email protected]>
Quoted 3 lines

Thanks, Vivek! I folded this into Guenter's patch and added your Signed-off-by for this designware-plat fix. I'll ask Linus to pull this before v4.11-rc1.

Thanks Bjorn.

BRs
Vivek

Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project