summaryrefslogtreecommitdiff
path: root/drivers/pci
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-03-02 17:44:39 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2018-03-02 17:44:39 -0800
commit329ad5e5445955b9de3438061303fdfbd03173de (patch)
tree65c5f3aa76eb93588ac1e826a22e3136ddb8784a /drivers/pci
parent5fbdefcf685defd8bc5a8f37b17538d25c58d77a (diff)
parentc37406e05d1e541df40b8b81c4bd40753fcaf414 (diff)
Merge tag 'pci-v4.16-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci
Pull PCI fixes from Bjorn Helgaas: - Update pci.ids location (documentation only) (Randy Dunlap) - Fix a crash when BIOS didn't assign a BAR and we try to enlarge it (Christian König) * tag 'pci-v4.16-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: PCI: Allow release of resources that were never assigned PCI: Update location of pci.ids file
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/setup-res.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c
index 369d48d6c6f1..365447240d95 100644
--- a/drivers/pci/setup-res.c
+++ b/drivers/pci/setup-res.c
@@ -401,6 +401,10 @@ void pci_release_resource(struct pci_dev *dev, int resno)
struct resource *res = dev->resource + resno;
pci_info(dev, "BAR %d: releasing %pR\n", resno, res);
+
+ if (!res->parent)
+ return;
+
release_resource(res);
res->end = resource_size(res) - 1;
res->start = 0;