Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4b892e65 authored by Mark McLoughlin's avatar Mark McLoughlin Committed by Rusty Russell
Browse files

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
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
}