diff options
author | Keith Busch <keith.busch@intel.com> | 2012-07-25 18:05:18 -0400 |
---|---|---|
committer | Matthew Wilcox <matthew.r.wilcox@intel.com> | 2012-07-26 12:23:38 -0400 |
commit | 5c42ea1643a630060f9e71e06d3933d244970967 (patch) | |
tree | 45a0acae315367d8807ccf0a128dcfd3138b430d /drivers | |
parent | e9ef46369f5107e634a93b7fc4e62a1f53343197 (diff) |
NVMe: Fix nvme module init when nvme_major is set
register_blkdev returns 0 when given a valid major number.
Reported-by:Ross Zwisler <ross.zwisler@intel.com>
Signed-off-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/block/nvme.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/block/nvme.c b/drivers/block/nvme.c index 38b9c73f6706..46e33eec6298 100644 --- a/drivers/block/nvme.c +++ b/drivers/block/nvme.c | |||
@@ -1716,9 +1716,11 @@ static int __init nvme_init(void) | |||
1716 | if (IS_ERR(nvme_thread)) | 1716 | if (IS_ERR(nvme_thread)) |
1717 | return PTR_ERR(nvme_thread); | 1717 | return PTR_ERR(nvme_thread); |
1718 | 1718 | ||
1719 | nvme_major = register_blkdev(nvme_major, "nvme"); | 1719 | result = register_blkdev(nvme_major, "nvme"); |
1720 | if (nvme_major <= 0) | 1720 | if (result < 0) |
1721 | goto kill_kthread; | 1721 | goto kill_kthread; |
1722 | else if (result > 0) | ||
1723 | nvme_major = result; | ||
1722 | 1724 | ||
1723 | result = pci_register_driver(&nvme_driver); | 1725 | result = pci_register_driver(&nvme_driver); |
1724 | if (result) | 1726 | if (result) |