Commit 4b892e65 authored by Mark McLoughlin's avatar Mark McLoughlin Committed by 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: default avatarDon Zickus <dzickus@redhat.com>
Signed-off-by: default avatarMark McLoughlin <markmc@redhat.com>
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
parent 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%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment