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: accepted/tizen/common/20141203.182822~15218^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4b892e6582e3a4fe01f623aea386907270d5bf83;p=platform%2Fkernel%2Flinux-arm64.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 193c8f0..bcec78f 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; }