ACPICA: fixup after acpi_get_object_info() change
authorBjorn Helgaas <bjorn.helgaas@hp.com>
Mon, 21 Sep 2009 19:28:49 +0000 (19:28 +0000)
committerLen Brown <len.brown@intel.com>
Fri, 25 Sep 2009 18:24:22 +0000 (14:24 -0400)
Commit 15b8dd53f5ffa changed info->hardware_id from a static array to
a pointer.  If hardware_id is non-NULL, it points to a NULL-terminated
string, so we don't need to terminate it explicitly.  However, it may
be NULL; in that case, we *can't* add a NULL terminator.

This causes a NULL pointer dereference oops for devices without _HID.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
CC: Lin Ming <ming.m.lin@intel.com>
CC: Bob Moore <robert.moore@intel.com>
CC: Gary Hade <garyhade@us.ibm.com>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/pci/hotplug/acpiphp_ibm.c

index a9d926b7d805e14d099188c891b8295f1eabe15e..e7be66dbac21c09c10e76f20aa5ec80f40ad696d 100644 (file)
@@ -406,7 +406,6 @@ static acpi_status __init ibm_find_acpi_device(acpi_handle handle,
                        __func__, status);
                return retval;
        }
-       info->hardware_id.string[sizeof(info->hardware_id.length) - 1] = '\0';
 
        if (info->current_status && (info->valid & ACPI_VALID_HID) &&
                        (!strcmp(info->hardware_id.string, IBM_HARDWARE_ID1) ||