diff options
-rw-r--r-- | drivers/nvme/host/pci.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index ba943f211687..ddd441b1516a 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c | |||
@@ -2556,11 +2556,6 @@ static int nvme_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
2556 | 2556 | ||
2557 | quirks |= check_vendor_combination_bug(pdev); | 2557 | quirks |= check_vendor_combination_bug(pdev); |
2558 | 2558 | ||
2559 | result = nvme_init_ctrl(&dev->ctrl, &pdev->dev, &nvme_pci_ctrl_ops, | ||
2560 | quirks); | ||
2561 | if (result) | ||
2562 | goto release_pools; | ||
2563 | |||
2564 | /* | 2559 | /* |
2565 | * Double check that our mempool alloc size will cover the biggest | 2560 | * Double check that our mempool alloc size will cover the biggest |
2566 | * command we support. | 2561 | * command we support. |
@@ -2578,6 +2573,11 @@ static int nvme_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
2578 | goto release_pools; | 2573 | goto release_pools; |
2579 | } | 2574 | } |
2580 | 2575 | ||
2576 | result = nvme_init_ctrl(&dev->ctrl, &pdev->dev, &nvme_pci_ctrl_ops, | ||
2577 | quirks); | ||
2578 | if (result) | ||
2579 | goto release_mempool; | ||
2580 | |||
2581 | dev_info(dev->ctrl.device, "pci function %s\n", dev_name(&pdev->dev)); | 2581 | dev_info(dev->ctrl.device, "pci function %s\n", dev_name(&pdev->dev)); |
2582 | 2582 | ||
2583 | nvme_get_ctrl(&dev->ctrl); | 2583 | nvme_get_ctrl(&dev->ctrl); |
@@ -2585,6 +2585,8 @@ static int nvme_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
2585 | 2585 | ||
2586 | return 0; | 2586 | return 0; |
2587 | 2587 | ||
2588 | release_mempool: | ||
2589 | mempool_destroy(dev->iod_mempool); | ||
2588 | release_pools: | 2590 | release_pools: |
2589 | nvme_release_prp_pools(dev); | 2591 | nvme_release_prp_pools(dev); |
2590 | unmap: | 2592 | unmap: |