[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 23/38] shpc: split shpc_free from shpc_cleanup
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH 23/38] shpc: split shpc_free from shpc_cleanup |
Date: |
Tue, 17 Sep 2013 11:58:12 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130805 Thunderbird/17.0.8 |
Il 17/09/2013 11:24, Michael S. Tsirkin ha scritto:
>> @@ -630,15 +630,21 @@ int shpc_bar_size(PCIDevice *d)
>> void shpc_cleanup(PCIDevice *d, MemoryRegion *bar)
>> {
>> SHPCDevice *shpc = d->shpc;
>> + /* TODO: cleanup config space changes? */
>> d->cap_present &= ~QEMU_PCI_CAP_SHPC;
>> memory_region_del_subregion(bar, &shpc->mmio);
>> - /* TODO: cleanup config space changes? */
>> +}
>> +
>> +void shpc_free(PCIDevice *d)
>> +{
>> + SHPCDevice *shpc = d->shpc;
>> g_free(shpc->config);
>> g_free(shpc->cmask);
>> g_free(shpc->wmask);
>> g_free(shpc->w1cmask);
>> memory_region_destroy(&shpc->mmio);
>> g_free(shpc);
>> + d->shpc = NULL;
I dislike having random dangling pointers. But it's not that bad if I
move the clearing of QEMU_PCI_CAP_SHPC from shpc_cleanup to shpc_free.
Paolo
- [Qemu-devel] [PATCH 16/38] vfio: reclaim memory in instance_finalize instead of exit, (continued)
- [Qemu-devel] [PATCH 16/38] vfio: reclaim memory in instance_finalize instead of exit, Paolo Bonzini, 2013/09/03
- [Qemu-devel] [PATCH 17/38] e1000: use instance_finalize instead of exit, Paolo Bonzini, 2013/09/03
- [Qemu-devel] [PATCH 18/38] eepro100: use instance_finalize instead of exit, Paolo Bonzini, 2013/09/03
- [Qemu-devel] [PATCH 19/38] ne2000: use instance_finalize instead of exit, Paolo Bonzini, 2013/09/03
- [Qemu-devel] [PATCH 20/38] pcnet: use instance_finalize instead of exit, Paolo Bonzini, 2013/09/03
- [Qemu-devel] [PATCH 22/38] vmxnet3: reclaim memory in instance_finalize instead of exit, Paolo Bonzini, 2013/09/03
- [Qemu-devel] [PATCH 21/38] rtl8139: use instance_finalize instead of exit, Paolo Bonzini, 2013/09/03
- [Qemu-devel] [PATCH 23/38] shpc: split shpc_free from shpc_cleanup, Paolo Bonzini, 2013/09/03
- [Qemu-devel] [PATCH 25/38] pcie_aer: pcie_aer_exit really frees stuff, Paolo Bonzini, 2013/09/03
- [Qemu-devel] [PATCH 24/38] pci_bridge: split pci_bridge_free from pci_bridge_exitfn, Paolo Bonzini, 2013/09/03
- [Qemu-devel] [PATCH 26/38] pci_bridge: reclaim memory in instance_finalize instead of exit, Paolo Bonzini, 2013/09/03
- [Qemu-devel] [PATCH 27/38] ioh4320: reclaim memory in instance_finalize instead of exit, Paolo Bonzini, 2013/09/03
- [Qemu-devel] [PATCH 28/38] xio3130-downstream: reclaim memory in instance_finalize instead of exit, Paolo Bonzini, 2013/09/03
- [Qemu-devel] [PATCH 29/38] xio3130-upstream: reclaim memory in instance_finalize instead of exit, Paolo Bonzini, 2013/09/03
- [Qemu-devel] [PATCH 30/38] pcie: do not recreate mmcfg I/O region, use an alias instead, Paolo Bonzini, 2013/09/03
- [Qemu-devel] [PATCH 31/38] esp: use instance_finalize instead of exit, Paolo Bonzini, 2013/09/03
- [Qemu-devel] [PATCH 32/38] lsi: use instance_finalize instead of exit, Paolo Bonzini, 2013/09/03