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 <[email protected]>
Signed-off-by: Lin Ming <[email protected]>
Signed-off-by: Len Brown <[email protected]>
This commit is contained in:
Thomas Renninger 2008-03-12 01:06:24 +01:00 • committed by Len Brown
commit b6a1638759

View file

@ -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;