diff options
author | Rafael J. Wysocki | 2018-12-21 10:03:16 +0100 |
---|---|---|
committer | Rafael J. Wysocki | 2018-12-21 10:03:16 +0100 |
commit | 1027fb0fb94aaaaa36ad58193fc61c36efaced85 (patch) | |
tree | 10808022e183c1618e36c4eb7a203877d32fc214 /drivers/acpi/acpica/exserial.c | |
parent | ACPI / OSI: Add OEM _OSI string to enable dGPU direct output (diff) | |
parent | ACPICA: Update version to 20181213 (diff) | |
download | kernel-qcow2-linux-1027fb0fb94aaaaa36ad58193fc61c36efaced85.tar.gz kernel-qcow2-linux-1027fb0fb94aaaaa36ad58193fc61c36efaced85.tar.xz kernel-qcow2-linux-1027fb0fb94aaaaa36ad58193fc61c36efaced85.zip |
Merge branch 'acpica'
* acpica:
ACPICA: Update version to 20181213
ACPICA: change coding style to match ACPICA, no functional change
ACPICA: Debug output: Add option to display method/object evaluation
ACPICA: disassembler: disassemble OEMx tables as AML
ACPICA: Add "Windows 2018.2" string in the _OSI support
ACPICA: Expressions in package elements are not supported
ACPICA: Update buffer-to-string conversions
ACPICA: add comments, no functional change
ACPICA: Remove defines that use deprecated flag
ACPICA: Add "Windows 2018" string in the _OSI support
ACPICA: Update version to 20181031
ACPICA: iASL: Enhance error detection
ACPICA: iASL: adding definition and disassembly for TPM2 revision 3
ACPICA: Use %d for signed int print formatting instead of %u
ACPICA: Debugger: refactor to fix unused variable warning
Diffstat (limited to 'drivers/acpi/acpica/exserial.c')
-rw-r--r-- | drivers/acpi/acpica/exserial.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/acpi/acpica/exserial.c b/drivers/acpi/acpica/exserial.c index 9920fac6413f..ec61553c4483 100644 --- a/drivers/acpi/acpica/exserial.c +++ b/drivers/acpi/acpica/exserial.c @@ -244,6 +244,7 @@ acpi_ex_write_serial_bus(union acpi_operand_object *source_desc, { acpi_status status; u32 buffer_length; + u32 data_length; void *buffer; union acpi_operand_object *buffer_desc; u32 function; @@ -324,8 +325,9 @@ acpi_ex_write_serial_bus(union acpi_operand_object *source_desc, /* Copy the input buffer data to the transfer buffer */ buffer = buffer_desc->buffer.pointer; - memcpy(buffer, source_desc->buffer.pointer, - min(buffer_length, source_desc->buffer.length)); + data_length = (buffer_length < source_desc->buffer.length ? + buffer_length : source_desc->buffer.length); + memcpy(buffer, source_desc->buffer.pointer, data_length); /* Lock entire transaction if requested */ |