aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorThomas Renninger <trenn@suse.de>2012-09-30 18:23:56 -0400
committerH. Peter Anvin <hpa@linux.intel.com>2012-09-30 21:03:35 -0400
commit325a8d36035f0623950e38e9cf7a47a48e72df11 (patch)
tree86f73df0091f7cdbed803c59d2d9995995e72557 /drivers/acpi
parentb2a35003dfbcc7b7a5e5c6e524e7d49ba66e0bb5 (diff)
ACPI: Create acpi_table_taint() function to avoid code duplication
There are two ways of overriding ACPI tables now, both need to taint the the kernel. Signed-off-by: Thomas Renninger <trenn@suse.de> Link: http://lkml.kernel.org/r/1349043837-22659-6-git-send-email-trenn@suse.de Cc: Len Brown <lenb@kernel.org> Cc: Robert Moore <robert.moore@intel.com> Cc: Yinghai Lu <yinghai@kernel.org> Cc: Eric Piel <eric.piel@tremplin-utc.net> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/osl.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index 007224bd4db7..a2845fff3997 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -656,6 +656,15 @@ void __init acpi_initrd_override(void *data, size_t size)
656} 656}
657#endif /* CONFIG_ACPI_INITRD_TABLE_OVERRIDE */ 657#endif /* CONFIG_ACPI_INITRD_TABLE_OVERRIDE */
658 658
659static void acpi_table_taint(struct acpi_table_header *table)
660{
661 pr_warn(PREFIX
662 "Override [%4.4s-%8.8s], this is unsafe: tainting kernel\n",
663 table->signature, table->oem_table_id);
664 add_taint(TAINT_OVERRIDDEN_ACPI_TABLE);
665}
666
667
659acpi_status 668acpi_status
660acpi_os_table_override(struct acpi_table_header * existing_table, 669acpi_os_table_override(struct acpi_table_header * existing_table,
661 struct acpi_table_header ** new_table) 670 struct acpi_table_header ** new_table)
@@ -669,13 +678,8 @@ acpi_os_table_override(struct acpi_table_header * existing_table,
669 if (strncmp(existing_table->signature, "DSDT", 4) == 0) 678 if (strncmp(existing_table->signature, "DSDT", 4) == 0)
670 *new_table = (struct acpi_table_header *)AmlCode; 679 *new_table = (struct acpi_table_header *)AmlCode;
671#endif 680#endif
672 if (*new_table != NULL) { 681 if (*new_table != NULL)
673 printk(KERN_WARNING PREFIX "Override [%4.4s-%8.8s], " 682 acpi_table_taint(existing_table);
674 "this is unsafe: tainting kernel\n",
675 existing_table->signature,
676 existing_table->oem_table_id);
677 add_taint(TAINT_OVERRIDDEN_ACPI_TABLE);
678 }
679 return AE_OK; 683 return AE_OK;
680} 684}
681 685
@@ -736,6 +740,8 @@ acpi_os_physical_table_override(struct acpi_table_header *existing_table,
736 break; 740 break;
737 } while (table_offset + ACPI_HEADER_SIZE < all_tables_size); 741 } while (table_offset + ACPI_HEADER_SIZE < all_tables_size);
738 742
743 if (*address != 0)
744 acpi_table_taint(existing_table);
739 return AE_OK; 745 return AE_OK;
740#endif 746#endif
741} 747}