diff options
author | MUNEDA Takahiro <muneda.takahiro@jp.fujitsu.com> | 2006-03-16 19:18:39 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-03-23 17:35:17 -0500 |
commit | b2e6e3ba7deb525f180df64f32f3fcb214538bea (patch) | |
tree | 116ae7111104708fce872b5d68dbd3fae7779174 /drivers/pci/hotplug/pciehp_hpc.c | |
parent | dc6712d1261ee4585771724320d28580888818eb (diff) |
[PATCH] acpiphp: fix acpi_path_name
I encountered the problem that the insmod of the acpiphp
fails because of the mis-freeing of the memory.
I tested this patch on my tiger4 box.
Signed-off-by: MUNEDA Takahiro <muneda.takahiro@jp.fujitsu.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/pci/hotplug/pciehp_hpc.c')
-rw-r--r-- | drivers/pci/hotplug/pciehp_hpc.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c index 22dcd12e4c1c..6c14d9e46b2e 100644 --- a/drivers/pci/hotplug/pciehp_hpc.c +++ b/drivers/pci/hotplug/pciehp_hpc.c | |||
@@ -1246,7 +1246,7 @@ int pciehp_acpi_get_hp_hw_control_from_firmware(struct pci_dev *dev) | |||
1246 | acpi_handle chandle, handle = DEVICE_ACPI_HANDLE(&(dev->dev)); | 1246 | acpi_handle chandle, handle = DEVICE_ACPI_HANDLE(&(dev->dev)); |
1247 | struct pci_dev *pdev = dev; | 1247 | struct pci_dev *pdev = dev; |
1248 | struct pci_bus *parent; | 1248 | struct pci_bus *parent; |
1249 | u8 *path_name = NULL; | 1249 | struct acpi_buffer string = { ACPI_ALLOCATE_BUFFER, NULL }; |
1250 | 1250 | ||
1251 | /* | 1251 | /* |
1252 | * Per PCI firmware specification, we should run the ACPI _OSC | 1252 | * Per PCI firmware specification, we should run the ACPI _OSC |
@@ -1278,16 +1278,17 @@ int pciehp_acpi_get_hp_hw_control_from_firmware(struct pci_dev *dev) | |||
1278 | } | 1278 | } |
1279 | 1279 | ||
1280 | while (handle) { | 1280 | while (handle) { |
1281 | path_name = acpi_path_name(handle); | 1281 | acpi_get_name(handle, ACPI_FULL_PATHNAME, &string); |
1282 | dbg("Trying to get hotplug control for %s \n", path_name); | 1282 | dbg("Trying to get hotplug control for %s \n", |
1283 | (char *)string.pointer); | ||
1283 | status = pci_osc_control_set(handle, | 1284 | status = pci_osc_control_set(handle, |
1284 | OSC_PCI_EXPRESS_NATIVE_HP_CONTROL); | 1285 | OSC_PCI_EXPRESS_NATIVE_HP_CONTROL); |
1285 | if (status == AE_NOT_FOUND) | 1286 | if (status == AE_NOT_FOUND) |
1286 | status = acpi_run_oshp(handle); | 1287 | status = acpi_run_oshp(handle); |
1287 | if (ACPI_SUCCESS(status)) { | 1288 | if (ACPI_SUCCESS(status)) { |
1288 | dbg("Gained control for hotplug HW for pci %s (%s)\n", | 1289 | dbg("Gained control for hotplug HW for pci %s (%s)\n", |
1289 | pci_name(dev), path_name); | 1290 | pci_name(dev), (char *)string.pointer); |
1290 | acpi_os_free(path_name); | 1291 | acpi_os_free(string.pointer); |
1291 | return 0; | 1292 | return 0; |
1292 | } | 1293 | } |
1293 | if (acpi_root_bridge(handle)) | 1294 | if (acpi_root_bridge(handle)) |
@@ -1300,8 +1301,8 @@ int pciehp_acpi_get_hp_hw_control_from_firmware(struct pci_dev *dev) | |||
1300 | 1301 | ||
1301 | err("Cannot get control of hotplug hardware for pci %s\n", | 1302 | err("Cannot get control of hotplug hardware for pci %s\n", |
1302 | pci_name(dev)); | 1303 | pci_name(dev)); |
1303 | if (path_name) | 1304 | |
1304 | acpi_os_free(path_name); | 1305 | acpi_os_free(string.pointer); |
1305 | return -1; | 1306 | return -1; |
1306 | } | 1307 | } |
1307 | #endif | 1308 | #endif |