Skip to content

Commit c3aaf08

Browse files
committed
PCI/PM: Call .bridge_d3() hook only if non-NULL
26ad34d ("PCI / ACPI: Whitelist D3 for more PCIe hotplug ports") added the struct pci_platform_pm_ops.bridge_d3() function pointer and platform_pci_bridge_d3() to use it. The .bridge_d3() op is implemented by acpi_pci_platform_pm, but not by mid_pci_platform_pm. We don't expect platform_pci_bridge_d3() to be called on Intel MID platforms, but nothing in the code itself would prevent that. Check the .bridge_d3() pointer for NULL before calling it. Fixes: 26ad34d ("PCI / ACPI: Whitelist D3 for more PCIe hotplug ports") Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
1 parent 8f3d9f3 commit c3aaf08

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/pci/pci.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -868,7 +868,9 @@ static inline bool platform_pci_need_resume(struct pci_dev *dev)
868868

869869
static inline bool platform_pci_bridge_d3(struct pci_dev *dev)
870870
{
871-
return pci_platform_pm ? pci_platform_pm->bridge_d3(dev) : false;
871+
if (pci_platform_pm && pci_platform_pm->bridge_d3)
872+
return pci_platform_pm->bridge_d3(dev);
873+
return false;
872874
}
873875

874876
/**

0 commit comments

Comments
 (0)