diff options
author | Li Zhijian <lizhijian@cn.fujitsu.com> | 2021-06-24 19:04:15 +0800 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2021-10-05 17:30:57 -0400 |
commit | 5c243345236b058a3d84c8cbc62802f3fffb273c (patch) | |
tree | 097f3b91290d115b756c22fad5a1f98555edb2ec /hw/acpi | |
parent | 243a9284a989a38e32ceb3990eb795f5cf6f3be0 (diff) | |
download | qemu-5c243345236b058a3d84c8cbc62802f3fffb273c.zip qemu-5c243345236b058a3d84c8cbc62802f3fffb273c.tar.gz qemu-5c243345236b058a3d84c8cbc62802f3fffb273c.tar.bz2 |
nvdimm: release the correct device list
Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
Message-Id: <20210624110415.187164-1-lizhijian@cn.fujitsu.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Diffstat (limited to 'hw/acpi')
-rw-r--r-- | hw/acpi/nvdimm.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/hw/acpi/nvdimm.c b/hw/acpi/nvdimm.c index 5f9b552..0d43da1 100644 --- a/hw/acpi/nvdimm.c +++ b/hw/acpi/nvdimm.c @@ -339,10 +339,10 @@ nvdimm_build_structure_caps(GArray *structures, uint32_t capabilities) static GArray *nvdimm_build_device_structure(NVDIMMState *state) { - GSList *device_list = nvdimm_get_device_list(); + GSList *device_list, *list = nvdimm_get_device_list(); GArray *structures = g_array_new(false, true /* clear */, 1); - for (; device_list; device_list = device_list->next) { + for (device_list = list; device_list; device_list = device_list->next) { DeviceState *dev = device_list->data; /* build System Physical Address Range Structure. */ @@ -357,7 +357,7 @@ static GArray *nvdimm_build_device_structure(NVDIMMState *state) /* build NVDIMM Control Region Structure. */ nvdimm_build_structure_dcr(structures, dev); } - g_slist_free(device_list); + g_slist_free(list); if (state->persistence) { nvdimm_build_structure_caps(structures, state->persistence); @@ -1333,9 +1333,9 @@ static void nvdimm_build_ssdt(GArray *table_offsets, GArray *table_data, void nvdimm_build_srat(GArray *table_data) { - GSList *device_list = nvdimm_get_device_list(); + GSList *device_list, *list = nvdimm_get_device_list(); - for (; device_list; device_list = device_list->next) { + for (device_list = list; device_list; device_list = device_list->next) { DeviceState *dev = device_list->data; Object *obj = OBJECT(dev); uint64_t addr, size; @@ -1348,7 +1348,7 @@ void nvdimm_build_srat(GArray *table_data) build_srat_memory(table_data, addr, size, node, MEM_AFFINITY_ENABLED | MEM_AFFINITY_NON_VOLATILE); } - g_slist_free(device_list); + g_slist_free(list); } void nvdimm_build_acpi(GArray *table_offsets, GArray *table_data, |