Pārlūkot izejas kodu

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 <dzickus@redhat.com>
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Mark McLoughlin 16 gadi atpakaļ
vecāks
revīzija
4b892e6582
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      drivers/virtio/virtio_pci.c

+ 1 - 1
drivers/virtio/virtio_pci.c

@@ -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;
 }
 }