Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=498fbb5d411fc8f6207c210796c9308bf54a51a5
Commit:     498fbb5d411fc8f6207c210796c9308bf54a51a5
Parent:     e80af3a8dbbbf431b2070cc760699f01c5a6ac69
Author:     Gary Hade <[EMAIL PROTECTED]>
AuthorDate: Wed Feb 6 15:43:05 2008 -0800
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Feb 21 15:34:35 2008 -0800

    PCI: hotplug: acpiphp_ibm: Remove get device information
    
    drivers/pci/hotplug/acpiphp_ibm.c:ibm_find_acpi_device() is not
    large enough to accommodate data returned by the _CID method
    executed from acpi_get_object_info().
    
    This patch eliminates the problem by letting ACPI code
    (instead of driver code) determine and obtain a correctly
    sized buffer.
    
    Signed-off-by: Gary Hade <[EMAIL PROTECTED]>
    Signed-off-by: Kristen Carlson Accardi <[EMAIL PROTECTED]>
    Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/pci/hotplug/acpiphp_ibm.c |   33 +++++++++++++++++----------------
 1 files changed, 17 insertions(+), 16 deletions(-)

diff --git a/drivers/pci/hotplug/acpiphp_ibm.c 
b/drivers/pci/hotplug/acpiphp_ibm.c
index 750ebd7..b0a22b9 100644
--- a/drivers/pci/hotplug/acpiphp_ibm.c
+++ b/drivers/pci/hotplug/acpiphp_ibm.c
@@ -395,33 +395,34 @@ static acpi_status __init 
ibm_find_acpi_device(acpi_handle handle,
 {
        acpi_handle *phandle = (acpi_handle *)context;
        acpi_status status; 
-       struct acpi_device_info info; 
-       struct acpi_buffer info_buffer = {
-               .length = sizeof(struct acpi_device_info),
-               .pointer = &info,
-       };
+       struct acpi_device_info *info;
+       struct acpi_buffer info_buffer = { ACPI_ALLOCATE_BUFFER, NULL };
+       int retval = 0;
 
        status = acpi_get_object_info(handle, &info_buffer);
        if (ACPI_FAILURE(status)) {
-               err("%s:  Failed to get device information\n", __FUNCTION__);
-               return 0;
+               err("%s:  Failed to get device information status=0x%x\n",
+                       __FUNCTION__, status);
+               return retval;
        }
-       info.hardware_id.value[sizeof(info.hardware_id.value) - 1] = '\0';
-
-       if (info.current_status && (info.valid & ACPI_VALID_HID) &&
-                       (!strcmp(info.hardware_id.value, IBM_HARDWARE_ID1) ||
-                       !strcmp(info.hardware_id.value, IBM_HARDWARE_ID2))) {
-               dbg("found hardware: %s, handle: %p\n", info.hardware_id.value,
-                               handle);
+       info = info_buffer.pointer;
+       info->hardware_id.value[sizeof(info->hardware_id.value) - 1] = '\0';
+
+       if (info->current_status && (info->valid & ACPI_VALID_HID) &&
+                       (!strcmp(info->hardware_id.value, IBM_HARDWARE_ID1) ||
+                        !strcmp(info->hardware_id.value, IBM_HARDWARE_ID2))) {
+               dbg("found hardware: %s, handle: %p\n",
+                       info->hardware_id.value, handle);
                *phandle = handle;
                /* returning non-zero causes the search to stop
                 * and returns this value to the caller of 
                 * acpi_walk_namespace, but it also causes some warnings
                 * in the acpi debug code to print...
                 */
-               return FOUND_APCI;
+               retval = FOUND_APCI;
        }
-       return 0;
+       kfree(info);
+       return retval;
 }
 
 static int __init ibm_acpiphp_init(void)
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to