From 0120baeea1c91f67cb5290724f9163bcad708b03 Mon Sep 17 00:00:00 2001 From: Ashok Vairavan Date: Mon, 5 Jun 2017 12:24:30 -0700 Subject: [PATCH] NVMe: During NVMe probe, get NVMe device information before mapping the device. Orabug: 26194850 As part of updating NVMe driver (Bug 25130845), the nvme device mapping was done before getting the nvme device information. This change got introduced while resolving a merge conflict. This caused the kernel panic during nvme probe. Signed-off-by: Ashok Vairavan Reviewed-by: Martin K. Petersen --- drivers/nvme/host/pci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 55005c5e240e..4f2d8536c0bc 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -1986,15 +1986,15 @@ static int nvme_probe(struct pci_dev *pdev, const struct pci_device_id *id) if (!dev->queues) goto free; + dev->dev = get_device(&pdev->dev); + pci_set_drvdata(pdev, dev); + result = nvme_dev_map(dev); if (result) goto free; INIT_LIST_HEAD(&dev->ctrl.namespaces); mutex_init(&dev->namespaces_mutex); - dev->dev = get_device(&pdev->dev); - pci_set_drvdata(pdev, dev); - INIT_WORK(&dev->reset_work, nvme_reset_work); INIT_WORK(&dev->remove_work, nvme_remove_dead_ctrl_work); setup_timer(&dev->watchdog_timer, nvme_watchdog_timer, -- 2.50.1