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-Url: https://git.stricted.de/?a=commitdiff_plain;h=b6a163875935ce8e8e85901a7f2b68f7a314d914;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.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 eba55b7d6c95..44ea60cf21c0 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;