提交 4b892e65 编写于 作者: M Mark McLoughlin 提交者: Rusty Russell

virtio-pci: correctly unregister root device on error

If pci_register_driver() fails we're incorrectly unregistering the root
device with device_unregister() rather than root_device_unregister().
Reported-by: NDon Zickus <dzickus@redhat.com>
Signed-off-by: NMark McLoughlin <markmc@redhat.com>
Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
上级 d9ecdea7
...@@ -669,7 +669,7 @@ static int __init virtio_pci_init(void) ...@@ -669,7 +669,7 @@ static int __init virtio_pci_init(void)
err = pci_register_driver(&virtio_pci_driver); err = pci_register_driver(&virtio_pci_driver);
if (err) if (err)
device_unregister(virtio_pci_root); root_device_unregister(virtio_pci_root);
return err; return err;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册