]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
NVMe: During NVMe probe, get NVMe device information before mapping the device.
authorAshok Vairavan <ashok.vairavan@oracle.com>
Mon, 5 Jun 2017 19:24:30 +0000 (12:24 -0700)
committerAshok Vairavan <ashok.vairavan@oracle.com>
Tue, 6 Jun 2017 15:32:33 +0000 (08:32 -0700)
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 <ashok.vairavan@oracle.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/nvme/host/pci.c

index 55005c5e240ed8913defc8ed18a2be8ca634778f..4f2d8536c0bcbe9625ce18c3132dfccb4274e136 100644 (file)
@@ -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,