Commit 3174ecd128ba5a4dc67de2a23cf2d385af1c4e70

Authored by Michael S. Tsirkin
Committed by Anthony Liguori
1 parent baef8a66

qemu: msix nit: clear msix_entries_nr on error

I don't think it's critical to do this, but it's
best to keep uninit and error recovery consistent.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Showing 1 changed file with 1 additions and 0 deletions
hw/msix.c
@@ -255,6 +255,7 @@ int msix_init(struct PCIDevice *dev, unsigned short nentries, @@ -255,6 +255,7 @@ int msix_init(struct PCIDevice *dev, unsigned short nentries,
255 return 0; 255 return 0;
256 256
257 err_config: 257 err_config:
  258 + dev->msix_entries_nr = 0;
258 cpu_unregister_io_memory(dev->msix_mmio_index); 259 cpu_unregister_io_memory(dev->msix_mmio_index);
259 err_index: 260 err_index:
260 qemu_free(dev->msix_table_page); 261 qemu_free(dev->msix_table_page);