]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/vfio/pci/vfio_pci.c
Merge remote-tracking branch 'asoc/topic/dmaengine' into asoc-next
[karo-tx-linux.git] / drivers / vfio / pci / vfio_pci.c
index dcd7c2a9961830b7fd1ff4155d5c302cd55fd809..324c52e3a1a47736a819826eea2d1974e47c7a87 100644 (file)
@@ -1142,6 +1142,10 @@ static int vfio_pci_mmap(void *device_data, struct vm_area_struct *vma)
                        return ret;
 
                vdev->barmap[index] = pci_iomap(pdev, index, 0);
+               if (!vdev->barmap[index]) {
+                       pci_release_selected_regions(pdev, 1 << index);
+                       return -ENOMEM;
+               }
        }
 
        vma->vm_private_data = vdev;