summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2016-06-06 14:25:33 (GMT)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2016-07-21 20:55:53 (GMT)
commit6ec39cf5cd6f77e3ff9ff1da75b758a47f939888 (patch)
tree710f72f4368e76730c415432b2c1640a5363d593 /drivers
parent92d21ac74a9e3c09b0b01c764e530657e4c85c49 (diff)
downloadlinux-6ec39cf5cd6f77e3ff9ff1da75b758a47f939888.tar.xz
PCI / PM: check all fields in pci_set_platform_pm()
When assign new PCI platform PM operations check for all mandatory fields to prevent NULL pointer dereference. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/pci/pci.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index c8b4dbd..badbddc 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -530,8 +530,8 @@ static const struct pci_platform_pm_ops *pci_platform_pm;
int pci_set_platform_pm(const struct pci_platform_pm_ops *ops)
{
- if (!ops->is_manageable || !ops->set_state || !ops->choose_state
- || !ops->sleep_wake)
+ if (!ops->is_manageable || !ops->set_state || !ops->choose_state ||
+ !ops->sleep_wake || !ops->run_wake || !ops->need_resume)
return -EINVAL;
pci_platform_pm = ops;
return 0;