http://bugzilla.kernel.org/show_bug.cgi?id=6859


[EMAIL PROTECTED] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|CLOSED                      |REOPENED
         Resolution|CODE_FIX                    |




------- Comment #15 from [EMAIL PROTECTED]  2008-05-15 14:42 -------

There is a problem with this patch, in this line:

if (ACPI_GET_OBJECT_TYPE (sub_object_list[3]) != ACPI_TYPE_INTEGER) {

In the case where the SourceName and SourceIndex are reversed, if the actual
SourceName was unresolved, the object will be null. That is the purpose of the
null check later in the code:

obj_desc = sub_object_list[source_name_index];
if (obj_desc) {

For safety, a check for a null SourceName must be made. A "correct" _PRT entry
will always have a valid integer object in index 3 for the SourceIndex, so the
safer code would be:

if (!sub_object_list[3] ||
    (ACPI_GET_OBJECT_TYPE (sub_object_list[3]) != ACPI_TYPE_INTEGER)) {

The ACPICA patch will simply swap the objects in place:

/*
 * If the BIOS has erroneously reversed the _PRT SourceName (index 2)
 * and the SourceIndex (index 3), fix it. _PRT is important enough to
 * workaround this BIOS error. This also provides compatibility with
 * other ACPI implementations.
 */
 ObjDesc = SubObjectList[3];
 if (!ObjDesc || (ACPI_GET_OBJECT_TYPE (ObjDesc) != ACPI_TYPE_INTEGER))
 {
    SubObjectList[3] = SubObjectList[2];
    SubObjectList[2] = ObjDesc;

    ACPI_WARNING ((AE_INFO,
        "(PRT[%X].Source) SourceName and SourceIndex are reversed, fixed",
        Index));
 }


-- 
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
acpi-bugzilla mailing list
acpi-bugzilla@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/acpi-bugzilla

Reply via email to