PCI/PM: Call .bridge_d3() hook only if non-NULL
authorBjorn Helgaas <bhelgaas@google.com>
Tue, 7 Apr 2020 23:23:15 +0000 (18:23 -0500)
committerBjorn Helgaas <bhelgaas@google.com>
Fri, 24 Apr 2020 19:33:47 +0000 (14:33 -0500)
commitc3aaf086701d05a82c8156ee8620af41e5a7d6fe
treea17393052db8d1f4cbedbbde64d4e7fea0004d32
parent8f3d9f354286745c751374f5f1fcafee6b3f3136
PCI/PM: Call .bridge_d3() hook only if non-NULL

26ad34d510a8 ("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: 26ad34d510a8 ("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>
drivers/pci/pci.c