Merge tag 'dm-4.1-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/device...
[cascardo/linux.git] / drivers / pci / setup-res.c
index b7c3a5e..232f925 100644 (file)
@@ -120,6 +120,7 @@ int pci_claim_resource(struct pci_dev *dev, int resource)
        if (!root) {
                dev_info(&dev->dev, "can't claim BAR %d %pR: no compatible bridge window\n",
                         resource, res);
+               res->flags |= IORESOURCE_UNSET;
                return -EINVAL;
        }
 
@@ -127,6 +128,7 @@ int pci_claim_resource(struct pci_dev *dev, int resource)
        if (conflict) {
                dev_info(&dev->dev, "can't claim BAR %d %pR: address conflict with %s %pR\n",
                         resource, res, conflict->name, conflict);
+               res->flags |= IORESOURCE_UNSET;
                return -EBUSY;
        }