mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-20 19:23:57 +08:00
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>
This commit is contained in:
parent
e9ef46369f
commit
5c42ea1643
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user