Skip to content

Commit

Permalink
virtio-pci: correctly unregister root device on error
Browse files Browse the repository at this point in the history
If pci_register_driver() fails we're incorrectly unregistering the root
device with device_unregister() rather than root_device_unregister().

Reported-by: Don Zickus <dzickus@redhat.com>
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  • Loading branch information
markmc authored and rustyrussell committed Jul 17, 2009
1 parent d9ecdea commit 4b892e6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/virtio/virtio_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 4b892e6

Please sign in to comment.