From: Mark McLoughlin Date: Tue, 7 Jul 2009 07:26:45 +0000 (+0100) Subject: virtio-pci: correctly unregister root device on error X-Git-Tag: Ubuntu-goldfish-3.4.0-4.27~10844^2~1 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=4b892e6582e3a4fe01f623aea386907270d5bf83;p=mirror_ubuntu-zesty-kernel.git 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: Don Zickus Signed-off-by: Mark McLoughlin Signed-off-by: Rusty Russell --- diff --git a/drivers/virtio/virtio_pci.c b/drivers/virtio/virtio_pci.c index 193c8f0e5cc5..bcec78ffc765 100644 --- a/drivers/virtio/virtio_pci.c +++ b/drivers/virtio/virtio_pci.c @@ -669,7 +669,7 @@ static int __init virtio_pci_init(void) err = pci_register_driver(&virtio_pci_driver); if (err) - device_unregister(virtio_pci_root); + root_device_unregister(virtio_pci_root); return err; }