diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2014-02-26 13:25:59 -0500 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2014-02-27 12:43:32 -0500 |
commit | cd8a4d3657c3f2cf9ce3780707be1debb8fea6e2 (patch) | |
tree | 76a9041b737f9f9620e9c4f2d1ba633fb792dcf2 /drivers/pci/setup-res.c | |
parent | 434aafc1aefb5eb6e8c8d15284c8f929be756521 (diff) |
PCI: Check IORESOURCE_UNSET before updating BAR
Check to make sure we don't update a BAR with an address we haven't
assigned.
If we haven't assigned an address to a resource, we shouldn't write it to a
BAR. This isn't a problem for the usual path via pci_assign_resource(),
which clears IORESOURCE_UNSET before calling pci_update_resource(), but
paths like pci_restore_bars() can call this for resources we haven't
assigned.
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci/setup-res.c')
-rw-r--r-- | drivers/pci/setup-res.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c index 725d5b28398c..7f7652176fc5 100644 --- a/drivers/pci/setup-res.c +++ b/drivers/pci/setup-res.c | |||
@@ -44,6 +44,9 @@ void pci_update_resource(struct pci_dev *dev, int resno) | |||
44 | if (!res->flags) | 44 | if (!res->flags) |
45 | return; | 45 | return; |
46 | 46 | ||
47 | if (res->flags & IORESOURCE_UNSET) | ||
48 | return; | ||
49 | |||
47 | /* | 50 | /* |
48 | * Ignore non-moveable resources. This might be legacy resources for | 51 | * Ignore non-moveable resources. This might be legacy resources for |
49 | * which no functional BAR register exists or another important | 52 | * which no functional BAR register exists or another important |