@@ -608,18 +608,12 @@ acpi_rs_get_list_length(u8 *aml_buffer,
608608
609609 case ACPI_RESOURCE_NAME_SERIAL_BUS :{
610610
611- /* Avoid undefined behavior: member access within misaligned address */
612-
613- struct aml_resource_common_serialbus
614- common_serial_bus ;
615- memcpy (& common_serial_bus , aml_resource ,
616- sizeof (common_serial_bus ));
617-
618611 minimum_aml_resource_length =
619612 acpi_gbl_resource_aml_serial_bus_sizes
620- [common_serial_bus .type ];
613+ [aml_resource -> common_serial_bus .type ];
621614 extra_struct_bytes +=
622- common_serial_bus .resource_length -
615+ aml_resource -> common_serial_bus .
616+ resource_length -
623617 minimum_aml_resource_length ;
624618 break ;
625619 }
@@ -688,16 +682,10 @@ acpi_rs_get_list_length(u8 *aml_buffer,
688682 */
689683 if (acpi_ut_get_resource_type (aml_buffer ) ==
690684 ACPI_RESOURCE_NAME_SERIAL_BUS ) {
691-
692- /* Avoid undefined behavior: member access within misaligned address */
693-
694- struct aml_resource_common_serialbus common_serial_bus ;
695- memcpy (& common_serial_bus , aml_resource ,
696- sizeof (common_serial_bus ));
697-
698685 buffer_size =
699686 acpi_gbl_resource_struct_serial_bus_sizes
700- [common_serial_bus .type ] + extra_struct_bytes ;
687+ [aml_resource -> common_serial_bus .type ] +
688+ extra_struct_bytes ;
701689 } else {
702690 buffer_size =
703691 acpi_gbl_resource_struct_sizes [resource_index ] +
0 commit comments