aboutsummaryrefslogtreecommitdiff
path: root/drivers/acpi/tables/tbget.c
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2006-07-10 02:39:41 -0400
committerLen Brown <len.brown@intel.com>2006-07-10 02:39:41 -0400
commit0f12b15ebcedce115a5d8e5ff741e49a7993f67c (patch)
tree3bfea88873b2a43c5528b9687fa010b6eff23458 /drivers/acpi/tables/tbget.c
parent20b499aa06edf59fa2d21f29d42d36586c6c058e (diff)
parentf6dd9221dddb3550e60d32aee688588ec208312c (diff)
Pull acpica-20060707 into test branch
Diffstat (limited to 'drivers/acpi/tables/tbget.c')
-rw-r--r--drivers/acpi/tables/tbget.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/acpi/tables/tbget.c b/drivers/acpi/tables/tbget.c
index 99eacceff56..7856db759af 100644
--- a/drivers/acpi/tables/tbget.c
+++ b/drivers/acpi/tables/tbget.c
@@ -320,6 +320,16 @@ acpi_tb_get_this_table(struct acpi_pointer *address,
ACPI_FUNCTION_TRACE(tb_get_this_table);
+ /* Validate minimum length */
+
+ if (header->length < sizeof(struct acpi_table_header)) {
+ ACPI_ERROR((AE_INFO,
+ "Table length (%X) is smaller than minimum (%X)",
+ header->length, sizeof(struct acpi_table_header)));
+
+ return_ACPI_STATUS(AE_INVALID_TABLE_LENGTH);
+ }
+
/*
* Flags contains the current processor mode (Virtual or Physical
* addressing) The pointer_type is either Logical or Physical
@@ -356,7 +366,7 @@ acpi_tb_get_this_table(struct acpi_pointer *address,
*/
status = acpi_os_map_memory(address->pointer.physical,
(acpi_size) header->length,
- (void *)&full_table);
+ ACPI_CAST_PTR(void, &full_table));
if (ACPI_FAILURE(status)) {
ACPI_ERROR((AE_INFO,
"Could not map memory for table [%4.4s] at %8.8X%8.8X for length %X",