Call pci_enable_device_mem() at initialisation and pci_disable_device
at exit.
Signed-off-by: Shane Michael Matthews <shane.matthews@intel.com>
Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
if (!dev->queues)
goto free;
+ if (pci_enable_device_mem(pdev))
+ goto free;
+
INIT_LIST_HEAD(&dev->namespaces);
dev->pci_dev = pdev;
pci_set_drvdata(pdev, dev);
disable:
pci_disable_msix(pdev);
nvme_release_instance(dev);
+ pci_disable_device(pdev);
free:
kfree(dev->queues);
kfree(dev->entry);
pci_disable_msix(pdev);
iounmap(dev->bar);
nvme_release_instance(dev);
+ pci_disable_device(pdev);
kfree(dev->queues);
kfree(dev->entry);
kfree(dev);