提交 5c42ea16 编写于 作者: K Keith Busch 提交者: Matthew Wilcox

NVMe: Fix nvme module init when nvme_major is set

register_blkdev returns 0 when given a valid major number.
Reported-by: NRoss Zwisler <ross.zwisler@intel.com>
Signed-off-by: NKeith Busch <keith.busch@intel.com>
Signed-off-by: NMatthew Wilcox <matthew.r.wilcox@intel.com>
上级 e9ef4636
......@@ -1716,9 +1716,11 @@ static int __init nvme_init(void)
if (IS_ERR(nvme_thread))
return PTR_ERR(nvme_thread);
nvme_major = register_blkdev(nvme_major, "nvme");
if (nvme_major <= 0)
result = register_blkdev(nvme_major, "nvme");
if (result < 0)
goto kill_kthread;
else if (result > 0)
nvme_major = result;
result = pci_register_driver(&nvme_driver);
if (result)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册