diff --git a/drivers/block/nvme-core.c b/drivers/block/nvme-core.c index ba278ae007052731c708e907a174fb4243470884..c1541652b7e03c1cb9dd65dc1f32bc93448e4e08 100644 --- a/drivers/block/nvme-core.c +++ b/drivers/block/nvme-core.c @@ -2156,6 +2156,9 @@ static int nvme_dev_map(struct nvme_dev *dev) dev->entry[0].vector = pdev->irq; pci_set_master(pdev); bars = pci_select_bars(pdev, IORESOURCE_MEM); + if (!bars) + goto disable_pci; + if (pci_request_selected_regions(pdev, bars, "nvme")) goto disable_pci;