From: Li Zhijian <lizhijian@cn.fujitsu.com>
To: <xiaoguangrong.eric@gmail.com>, <mst@redhat.com>, <imammedo@redhat.com>
Cc: qemu-devel@nongnu.org, Li Zhijian <lizhijian@cn.fujitsu.com>
Subject: [PATCH] nvdimm: release the correct device list
Date: Thu, 24 Jun 2021 19:04:15 +0800 [thread overview]
Message-ID: <20210624110415.187164-1-lizhijian@cn.fujitsu.com> (raw)
Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
---
hw/acpi/nvdimm.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/hw/acpi/nvdimm.c b/hw/acpi/nvdimm.c
index e3d5fe19392..ff317263e85 100644
--- a/hw/acpi/nvdimm.c
+++ b/hw/acpi/nvdimm.c
@@ -355,10 +355,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. */
@@ -373,7 +373,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);
@@ -1339,9 +1339,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) {
AcpiSratMemoryAffinity *numamem = NULL;
DeviceState *dev = device_list->data;
Object *obj = OBJECT(dev);
@@ -1356,7 +1356,7 @@ void nvdimm_build_srat(GArray *table_data)
build_srat_memory(numamem, 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,
--
2.31.1
next reply other threads:[~2021-06-24 11:18 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-24 11:04 Li Zhijian [this message]
2021-06-29 14:05 ` [PATCH] nvdimm: release the correct device list Igor Mammedov
2021-08-03 4:00 ` Li, Zhijian/李 智坚
2021-08-30 1:06 ` lizhijian
2021-09-13 6:40 ` lizhijian
2021-09-17 12:59 ` Igor Mammedov
2021-09-22 6:40 ` Michael S. Tsirkin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210624110415.187164-1-lizhijian@cn.fujitsu.com \
--to=lizhijian@cn.fujitsu.com \
--cc=imammedo@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=xiaoguangrong.eric@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.