virtio: pci: Fix an error handling path in vp_modern_probe()
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sun, 3 Apr 2022 09:11:14 +0000 (11:11 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 31 May 2022 16:45:08 +0000 (12:45 -0400)
If an error occurs after a successful pci_request_selected_regions() call,
it should be undone by a corresponding pci_release_selected_regions() call,
as already done in vp_modern_remove().

Fixes: fd502729fbbf ("virtio-pci: introduce modern device module")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Message-Id: <237109725aad2c3c03d14549f777b1927c84b045.1648977064.git.christophe.jaillet@wanadoo.fr>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/virtio/virtio_pci_modern_dev.c

index 591738ad3d565bc4d26b053d7cc2b42b70eff0cb..4093f9cca7a6ad1c77448447908525aa84d49fc4 100644 (file)
@@ -347,6 +347,7 @@ err_map_notify:
 err_map_isr:
        pci_iounmap(pci_dev, mdev->common);
 err_map_common:
+       pci_release_selected_regions(pci_dev, mdev->modern_bars);
        return err;
 }
 EXPORT_SYMBOL_GPL(vp_modern_probe);