mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
ACPI: Use ACPICA native way to decode the PLD buffer
This patch is on top of the ACPICA 20120816 release, which implemented a native way to decode PLD buffer, so use it instead of leting upper level users do the decoding. v2: Modify the check for PLD buffer length to reject buffers whose length < 16 Signed-off-by: Feng Tang <[email protected]> Signed-off-by: Bob Moore <[email protected]> Signed-off-by: Len Brown <[email protected]>
This commit is contained in:
parent
7560452c1a
commit
8ede06aba5
2 changed files with 8 additions and 34 deletions
|
|
@ -384,7 +384,7 @@ acpi_evaluate_reference(acpi_handle handle,
|
|||
EXPORT_SYMBOL(acpi_evaluate_reference);
|
||||
|
||||
acpi_status
|
||||
acpi_get_physical_device_location(acpi_handle handle, struct acpi_pld *pld)
|
||||
acpi_get_physical_device_location(acpi_handle handle, struct acpi_pld_info **pld)
|
||||
{
|
||||
acpi_status status;
|
||||
struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
|
||||
|
|
@ -400,13 +400,16 @@ acpi_get_physical_device_location(acpi_handle handle, struct acpi_pld *pld)
|
|||
if (!output || output->type != ACPI_TYPE_PACKAGE
|
||||
|| !output->package.count
|
||||
|| output->package.elements[0].type != ACPI_TYPE_BUFFER
|
||||
|| output->package.elements[0].buffer.length > sizeof(*pld)) {
|
||||
|| output->package.elements[0].buffer.length < ACPI_PLD_REV1_BUFFER_SIZE) {
|
||||
status = AE_TYPE;
|
||||
goto out;
|
||||
}
|
||||
|
||||
memcpy(pld, output->package.elements[0].buffer.pointer,
|
||||
output->package.elements[0].buffer.length);
|
||||
status = acpi_decode_pld_buffer(
|
||||
output->package.elements[0].buffer.pointer,
|
||||
output->package.elements[0].buffer.length,
|
||||
pld);
|
||||
|
||||
out:
|
||||
kfree(buffer.pointer);
|
||||
return status;
|
||||
|
|
|
|||
Loading…
Reference in a new issue