From: Thomas Renninger Date: Wed, 12 Mar 2008 00:06:24 +0000 (+0100) Subject: ACPICA: Warn if packages with invalid references are evaluated X-Git-Tag: v2.6.25-rc6~19^2~2^3~1 X-Git-Url: http://www.pilppa.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=b6a163875935ce8e8e85901a7f2b68f7a314d914;p=linux-2.6-omap-h63xx.git ACPICA: Warn if packages with invalid references are evaluated And return an error to avoid NULL pointer access by the caller Lin Ming's patch avoids corrupted mem access when BIOS has invalid references included, the handle is now zero instead of corrupted. Signed-off-by: Thomas Renninger Signed-off-by: Lin Ming Signed-off-by: Len Brown --- diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c index eba55b7d6c9..44ea60cf21c 100644 --- a/drivers/acpi/utils.c +++ b/drivers/acpi/utils.c @@ -407,6 +407,12 @@ acpi_evaluate_reference(acpi_handle handle, break; } + if (!element->reference.handle) { + printk(KERN_WARNING PREFIX "Invalid reference in" + " package %s\n", pathname); + status = AE_NULL_ENTRY; + break; + } /* Get the acpi_handle. */ list->handles[i] = element->reference.handle;