From 13a4a6ba2bfd3cf9bd34a015929d93868d792de8 Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Thu, 7 Nov 2024 12:34:42 +0000 Subject: [PATCH] hw/acpi: Fix size of HID in build_append_srat_acpi_device_handle() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The size should always be 8 so hard code that. By coincidience the incorrect use of sizeof(char *) is 8 on 64 bit hosts, but was caught by CI testing with i686 as the host. Reported-by: Michael S. Tsirkin Closes: https://lore.kernel.org/qemu-devel/20241104110025-mutt-send-email-mst@kernel.org/ Signed-off-by: Jonathan Cameron Message-Id: <20241107123446.902801-2-Jonathan.Cameron@huawei.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Daniel P. Berrangé --- hw/acpi/aml-build.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index 6a766261770..72282b173ec 100644 --- a/hw/acpi/aml-build.c +++ b/hw/acpi/aml-build.c @@ -1960,7 +1960,7 @@ static void build_append_srat_acpi_device_handle(GArray *table_data, { assert(strlen(hid) == 8); /* Device Handle - ACPI */ - for (int i = 0; i < sizeof(hid); i++) { + for (int i = 0; i < 8; i++) { build_append_int_noprefix(table_data, hid[i], 1); } build_append_int_noprefix(table_data, uid, 4); -- 2.39.5