From 3b1c1c1118880921da1188b7245e0470742802f8 Mon Sep 17 00:00:00 2001 From: Matthew Garrett Date: Wed, 1 Apr 2009 19:52:29 +0100 Subject: drm/i915: Unregister ACPI video driver when exiting The i915 DRM triggers registration of the ACPI video driver on load. It should unregister it at unload in order to avoid generating backtraces on being reloaded. Signed-off-by: Matthew Garrett Signed-off-by: Eric Anholt --- drivers/acpi/video.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/acpi') diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index cd4fb7543a9..8961e613e09 100644 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c @@ -2293,7 +2293,7 @@ static int __init acpi_video_init(void) return acpi_video_register(); } -static void __exit acpi_video_exit(void) +void __exit acpi_video_exit(void) { acpi_bus_unregister_driver(&acpi_video_bus); @@ -2302,6 +2302,7 @@ static void __exit acpi_video_exit(void) return; } +EXPORT_SYMBOL(acpi_video_exit); module_init(acpi_video_init); module_exit(acpi_video_exit); -- cgit v1.2.3 From 53951bd57dfe2da58f86cdf276719082d80d8485 Mon Sep 17 00:00:00 2001 From: Robert Moore Date: Sat, 2 May 2009 11:48:37 -0700 Subject: acpica: validate package element more carefully in acpi_rs_get_pci_routing_table_length acpi_rs_get_pci_routing_table_length is not performing sufficient validation on the package returned from _PRT. It assumes a package of packages and fails/faults if this is not the case. We should validate each subpackage when extracted from the parent package, and not accept objects of the wrong type, since that will just cause the scanning to fail (likely with a kernel oops). This can only happen with a serious BIOS bug, and is accompanied by a warning something like this: ACPI Warning (nspredef-0949): \_SB_.PCI0.PEG4._PRT: Return Package type mismatch at index 0 - found Integer, expected Package [20090320] Signed-off-by: Linus Torvalds --- drivers/acpi/acpica/rscalc.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'drivers/acpi') diff --git a/drivers/acpi/acpica/rscalc.c b/drivers/acpi/acpica/rscalc.c index b6667ff059e..88b5a2c4814 100644 --- a/drivers/acpi/acpica/rscalc.c +++ b/drivers/acpi/acpica/rscalc.c @@ -543,6 +543,13 @@ acpi_rs_get_pci_routing_table_length(union acpi_operand_object *package_object, package_element = *top_object_list; + /* We must have a valid Package object */ + + if (!package_element || + (package_element->common.type != ACPI_TYPE_PACKAGE)) { + return_ACPI_STATUS (AE_AML_OPERAND_TYPE); + } + /* * The sub_object_list will now point to an array of the * four IRQ elements: Address, Pin, Source and source_index -- cgit v1.2.3