diff options
Diffstat (limited to 'source/components/resources/rscalc.c')
-rw-r--r-- | source/components/resources/rscalc.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/source/components/resources/rscalc.c b/source/components/resources/rscalc.c index 9e1f4b022c0f..581803865206 100644 --- a/source/components/resources/rscalc.c +++ b/source/components/resources/rscalc.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp. * All rights reserved. * * 2. License @@ -741,15 +741,11 @@ AcpiRsGetListLength ( break; case ACPI_RESOURCE_NAME_SERIAL_BUS: { - /* Avoid undefined behavior: member access within misaligned address */ - - AML_RESOURCE_COMMON_SERIALBUS CommonSerialBus; - memcpy(&CommonSerialBus, AmlResource, sizeof(CommonSerialBus)); MinimumAmlResourceLength = AcpiGbl_ResourceAmlSerialBusSizes[ - CommonSerialBus.Type]; + AmlResource->CommonSerialBus.Type]; ExtraStructBytes += - CommonSerialBus.ResourceLength - + AmlResource->CommonSerialBus.ResourceLength - MinimumAmlResourceLength; break; } @@ -821,13 +817,8 @@ AcpiRsGetListLength ( if (AcpiUtGetResourceType (AmlBuffer) == ACPI_RESOURCE_NAME_SERIAL_BUS) { - /* Avoid undefined behavior: member access within misaligned address */ - - AML_RESOURCE_COMMON_SERIALBUS CommonSerialBus; - memcpy(&CommonSerialBus, AmlResource, sizeof(CommonSerialBus)); - BufferSize = AcpiGbl_ResourceStructSerialBusSizes[ - CommonSerialBus.Type] + ExtraStructBytes; + AmlResource->CommonSerialBus.Type] + ExtraStructBytes; } else { |