Re: [PATCH] Don't unregister unassigned PCI BAR

Chris Wright
2009-02-12T01:35:53Z

* Gleb Natapov (gleb@redhat.com) wrote:
> --- a/qemu/hw/pci.c
> +++ b/qemu/hw/pci.c
> @@ -213,7 +213,7 @@ static void pci_unregister_io_regions(PCIDevice *pci_dev)
>
> for(i = 0; i < PCI_NUM_REGIONS; i++) {
> r = &pci_dev->io_regions[i];
> - if (!r->size)
> + if (!r->size || r->addr == -1)
> continue;

Without this patch the error path for device assignment will segfault
(trying to unregister addr -1). Please consider for maint/2.6.29.

thanks,
-chris