aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2012-08-20 11:06:21 -0400
committerAlex Deucher <alexander.deucher@amd.com>2012-08-20 11:13:05 -0400
commit7c3906d04a4587dceaa78cc1ae6b14e6454ee02a (patch)
treeafb0b0af2918f56e2e2588670b3535009bd040df
parent4f81f986761a7663db7d24d24cd6ae68008f1fc2 (diff)
drm/radeon: convert radeon vfct code to use acpi_get_table_with_size
Allows us to verify the table size. Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
-rw-r--r--drivers/gpu/drm/radeon/radeon_bios.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_bios.c b/drivers/gpu/drm/radeon/radeon_bios.c
index a32232fc7bd..ab0b2f7292a 100644
--- a/drivers/gpu/drm/radeon/radeon_bios.c
+++ b/drivers/gpu/drm/radeon/radeon_bios.c
@@ -482,13 +482,12 @@ static bool radeon_acpi_vfct_bios(struct radeon_device *rdev)
482{ 482{
483 bool ret = false; 483 bool ret = false;
484 struct acpi_table_header *hdr; 484 struct acpi_table_header *hdr;
485 /* acpi_get_table_with_size is not exported :( */ 485 acpi_size tbl_size;
486 acpi_size tbl_size = 0x7fffffff;
487 UEFI_ACPI_VFCT *vfct; 486 UEFI_ACPI_VFCT *vfct;
488 GOP_VBIOS_CONTENT *vbios; 487 GOP_VBIOS_CONTENT *vbios;
489 VFCT_IMAGE_HEADER *vhdr; 488 VFCT_IMAGE_HEADER *vhdr;
490 489
491 if (!ACPI_SUCCESS(acpi_get_table("VFCT", 1, &hdr))) 490 if (!ACPI_SUCCESS(acpi_get_table_with_size("VFCT", 1, &hdr, &tbl_size)))
492 return false; 491 return false;
493 if (tbl_size < sizeof(UEFI_ACPI_VFCT)) { 492 if (tbl_size < sizeof(UEFI_ACPI_VFCT)) {
494 DRM_ERROR("ACPI VFCT table present but broken (too short #1)\n"); 493 DRM_ERROR("ACPI VFCT table present but broken (too short #1)\n");
@@ -525,7 +524,6 @@ static bool radeon_acpi_vfct_bios(struct radeon_device *rdev)
525 ret = !!rdev->bios; 524 ret = !!rdev->bios;
526 525
527out_unmap: 526out_unmap:
528 /* uh, no idea what to do here... */
529 return ret; 527 return ret;
530} 528}
531#else 529#else