Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1212650

[PATCH 02/20] ACPICA: Disassembler: Remove duplicate code in _PLD processing.

From Lv Zheng <lv.zheng@intel.com>
Newsgroups linux.kernel
Subject [PATCH 02/20] ACPICA: Disassembler: Remove duplicate code in _PLD processing.
Date 2015-08-25 04:30 +0200
Message-ID <q1c9P-1tt-9@gated-at.bofh.it> (permalink)
References <q1c9P-1tt-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Bob Moore <robert.moore@intel.com>

ACPICA commit 6d9c827b540837b6e54059e17756a06985e4a196

ACPICA BZ 1176.

Link: https://bugs.acpica.org/show_bug.cgi?id=1176
Link: https://github.com/acpica/acpica/commit/6d9c827b
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
 drivers/acpi/acpica/utxface.c |    5 +++--
 include/acpi/acbuffer.h       |    1 +
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/acpi/acpica/utxface.c b/drivers/acpi/acpica/utxface.c
index 51cf52d..c2bd5e2 100644
--- a/drivers/acpi/acpica/utxface.c
+++ b/drivers/acpi/acpica/utxface.c
@@ -517,7 +517,8 @@ acpi_decode_pld_buffer(u8 *in_buffer,
 
 	/* Parameter validation */
 
-	if (!in_buffer || !return_buffer || (length < 16)) {
+	if (!in_buffer || !return_buffer
+	    || (length < ACPI_PLD_REV1_BUFFER_SIZE)) {
 		return (AE_BAD_PARAMETER);
 	}
 
@@ -567,7 +568,7 @@ acpi_decode_pld_buffer(u8 *in_buffer,
 	pld_info->rotation = ACPI_PLD_GET_ROTATION(&dword);
 	pld_info->order = ACPI_PLD_GET_ORDER(&dword);
 
-	if (length >= ACPI_PLD_BUFFER_SIZE) {
+	if (length >= ACPI_PLD_REV2_BUFFER_SIZE) {
 
 		/* Fifth 32-bit DWord (Revision 2 of _PLD) */
 
diff --git a/include/acpi/acbuffer.h b/include/acpi/acbuffer.h
index 6b040f4..fcf9080 100644
--- a/include/acpi/acbuffer.h
+++ b/include/acpi/acbuffer.h
@@ -147,6 +147,7 @@ struct acpi_pld_info {
  *        (Intended for BIOS use only)
  */
 #define ACPI_PLD_REV1_BUFFER_SIZE               16	/* For Revision 1 of the buffer (From ACPI spec) */
+#define ACPI_PLD_REV2_BUFFER_SIZE               20	/* For Revision 2 of the buffer (From ACPI spec) */
 #define ACPI_PLD_BUFFER_SIZE                    20	/* For Revision 2 of the buffer (From ACPI spec) */
 
 /* First 32-bit dword, bits 0:32 */
-- 
1.7.10

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 00/20] ACPICA: 20150818 Release Lv Zheng <lv.zheng@intel.com> - 2015-08-25 04:30 +0200
  [PATCH 08/20] ACPICA: Headers: Fix some comments, no functional change. Lv Zheng <lv.zheng@intel.com> - 2015-08-25 04:30 +0200
  [PATCH 02/20] ACPICA: Disassembler: Remove duplicate code in _PLD processing. Lv Zheng <lv.zheng@intel.com> - 2015-08-25 04:30 +0200
  [PATCH 06/20] ACPICA: Tables: Fix global table list issues by removing fixed table indexes. Lv Zheng <lv.zheng@intel.com> - 2015-08-25 04:30 +0200
  [PATCH 12/20] ACPICA: Add additional debug info/statements. Lv Zheng <lv.zheng@intel.com> - 2015-08-25 04:30 +0200
  [PATCH 04/20] ACPICA: Disassembler: Update for new listing mode. Lv Zheng <lv.zheng@intel.com> - 2015-08-25 04:30 +0200
  [PATCH 07/20] ACPICA: Tables: Cleanup to reduce FACS globals. Lv Zheng <lv.zheng@intel.com> - 2015-08-25 04:30 +0200
  [PATCH 09/20] ACPICA: acpinames: Add new options and wildcard support. Lv Zheng <lv.zheng@intel.com> - 2015-08-25 04:30 +0200
  [PATCH 05/20] ACPICA: Update info messages during ACPICA init. Lv Zheng <lv.zheng@intel.com> - 2015-08-25 04:30 +0200
  [PATCH 11/20] ACPICA: Table handling: Cleanup and update debug output for tools. Lv Zheng <lv.zheng@intel.com> - 2015-08-25 04:30 +0200
  [PATCH 10/20] ACPICA: acpiexec/acpinames: Support very large number of ACPI tables. Lv Zheng <lv.zheng@intel.com> - 2015-08-25 04:30 +0200
  [PATCH 01/20] ACPICA: Correctly cleanup after a ACPI table load failure. Lv Zheng <lv.zheng@intel.com> - 2015-08-25 04:30 +0200
  [PATCH 19/20] ACPICA: Debugger: Cleanup debugging outputs to dump name path without trailing underscores. Lv Zheng <lv.zheng@intel.com> - 2015-08-25 04:40 +0200
  [PATCH 03/20] ACPICA: Update parameter validation for data_table_region and load_table. Lv Zheng <lv.zheng@intel.com> - 2015-08-25 04:40 +0200
  [PATCH 16/20] ACPICA: Debugger: Split debugger initialization/termination APIs. Lv Zheng <lv.zheng@intel.com> - 2015-08-25 04:40 +0200
  [PATCH 14/20] ACPICA: Make the max-number-of-loops runtime configurable. Lv Zheng <lv.zheng@intel.com> - 2015-08-25 04:40 +0200
  [PATCH 20/20] ACPICA: Update version to 20150818. Lv Zheng <lv.zheng@intel.com> - 2015-08-25 04:40 +0200
  [PATCH 17/20] ACPICA: Disassembler: Cleanup acpi_gbl_db_opt_disasm. Lv Zheng <lv.zheng@intel.com> - 2015-08-25 04:40 +0200
  [PATCH 13/20] ACPICA: Debugger: Add option to display namespace summary/counts. Lv Zheng <lv.zheng@intel.com> - 2015-08-25 04:40 +0200
  [PATCH 18/20] ACPICA: Disassembler: Cleanup acpi_gbl_db_opt_verbose acpiexec usage. Lv Zheng <lv.zheng@intel.com> - 2015-08-25 04:40 +0200
  [PATCH 15/20] ACPICA: Header support to improve compatibility with MSVC. Lv Zheng <lv.zheng@intel.com> - 2015-08-25 04:40 +0200
  Re: [PATCH 00/20] ACPICA: 20150818 Release "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2015-08-26 01:30 +0200

csiph-web