[PATCH] pci: check saved state before restore

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>From f701d50e53d794309d92980ffa77d54606d44601 Mon Sep 17 00:00:00 2001
From: Alek Du <alek.du@xxxxxxxxx>
Date: Wed, 5 Aug 2009 15:25:26 +0800
Subject: [PATCH] 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.

Signed-off-by: Alek Du <alek.du@xxxxxxxxx>
---
 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 dbd0f94..7b70312 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);
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux