mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
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 <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
This commit is contained in:
parent
92d21ac74a
commit
6ec39cf5cd
1 changed files with 2 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue