diff options
author | Alek Du <alek.du@intel.com> | 2009-08-08 02:46:19 +0200 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2009-08-20 18:08:45 +0200 |
commit | c82f63e411f1b58427c103bd95af2863b1c96dd1 (patch) | |
tree | 4a18447facd22c384c871e312cb3183c01a44b2c /drivers/pci/pci.c | |
parent | Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ryu... (diff) | |
download | linux-c82f63e411f1b58427c103bd95af2863b1c96dd1.tar.xz linux-c82f63e411f1b58427c103bd95af2863b1c96dd1.zip |
PCI: check saved state before restore
Without the check, the config space may be filled with zeros. Though
the driver should try to avoid call restoring before saving, but the
pci layer also should check this.
Also removes the existing check in pci_restore_standard_config, since
it's superfluous with the new check in restore_state.
Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Alek Du <alek.du@intel.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci/pci.c')
-rw-r--r-- | drivers/pci/pci.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index dbd0f947f497..7b70312181d7 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -846,6 +846,8 @@ pci_restore_state(struct pci_dev *dev) int i; u32 val; + if (!dev->state_saved) + return 0; /* PCI Express register must be restored first */ pci_restore_pcie_state(dev); |