diff options
| author | Keith Busch <keith.busch@intel.com> | 2014-03-03 13:09:47 -0500 |
|---|---|---|
| committer | Matthew Wilcox <matthew.r.wilcox@intel.com> | 2014-03-24 08:15:14 -0400 |
| commit | fb35e914b3f88cda9ee6f9d776910c35269c4ecf (patch) | |
| tree | 0bca372b7e76d285f3ac63429743930659c69c32 /drivers/block | |
| parent | 671a6018db1d359254c8201704cf967efb42fc25 (diff) | |
NVMe: Initialize device reference count earlier
If an NVMe device becomes ready but fails to create IO queues, the driver
creates a character device handle so the device can be managed. The
device reference count needs to be initialized before creating the
character device.
Signed-off-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
Diffstat (limited to 'drivers/block')
| -rw-r--r-- | drivers/block/nvme-core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/block/nvme-core.c b/drivers/block/nvme-core.c index 87dd4c79e65f..f565212a9e32 100644 --- a/drivers/block/nvme-core.c +++ b/drivers/block/nvme-core.c | |||
| @@ -2464,6 +2464,7 @@ static int nvme_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
| 2464 | if (result) | 2464 | if (result) |
| 2465 | goto release; | 2465 | goto release; |
| 2466 | 2466 | ||
| 2467 | kref_init(&dev->kref); | ||
| 2467 | result = nvme_dev_start(dev); | 2468 | result = nvme_dev_start(dev); |
| 2468 | if (result) { | 2469 | if (result) { |
| 2469 | if (result == -EBUSY) | 2470 | if (result == -EBUSY) |
| @@ -2471,7 +2472,6 @@ static int nvme_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
| 2471 | goto release_pools; | 2472 | goto release_pools; |
| 2472 | } | 2473 | } |
| 2473 | 2474 | ||
| 2474 | kref_init(&dev->kref); | ||
| 2475 | result = nvme_dev_add(dev); | 2475 | result = nvme_dev_add(dev); |
| 2476 | if (result) | 2476 | if (result) |
| 2477 | goto shutdown; | 2477 | goto shutdown; |
