Commit bef63808 authored by Len Brown's avatar Len Brown Committed by Len Brown
parent 2a539154
...@@ -276,17 +276,25 @@ int acpi_pci_unbind( ...@@ -276,17 +276,25 @@ int acpi_pci_unbind(
int result = 0; int result = 0;
acpi_status status = AE_OK; acpi_status status = AE_OK;
struct acpi_pci_data *data = NULL; struct acpi_pci_data *data = NULL;
char pathname[ACPI_PATHNAME_MAX] = {0}; char *pathname = NULL;
struct acpi_buffer buffer = {ACPI_PATHNAME_MAX, pathname}; struct acpi_buffer buffer = {0, NULL};
ACPI_FUNCTION_TRACE("acpi_pci_unbind"); ACPI_FUNCTION_TRACE("acpi_pci_unbind");
if (!device || !device->parent) if (!device || !device->parent)
return_VALUE(-EINVAL); return_VALUE(-EINVAL);
pathname = (char *) kmalloc(ACPI_PATHNAME_MAX, GFP_KERNEL);
if(!pathname)
return_VALUE(-ENOMEM);
memset(pathname, 0, ACPI_PATHNAME_MAX);
buffer.length = ACPI_PATHNAME_MAX;
buffer.pointer = pathname;
acpi_get_name(device->handle, ACPI_FULL_PATHNAME, &buffer); acpi_get_name(device->handle, ACPI_FULL_PATHNAME, &buffer);
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Unbinding PCI device [%s]...\n", ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Unbinding PCI device [%s]...\n",
pathname)); pathname));
kfree(pathname);
status = acpi_get_data(device->handle, acpi_pci_data_handler, (void**)&data); status = acpi_get_data(device->handle, acpi_pci_data_handler, (void**)&data);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
......
...@@ -244,26 +244,34 @@ acpi_evaluate_integer ( ...@@ -244,26 +244,34 @@ acpi_evaluate_integer (
unsigned long *data) unsigned long *data)
{ {
acpi_status status = AE_OK; acpi_status status = AE_OK;
union acpi_object element; union acpi_object *element;
struct acpi_buffer buffer = {sizeof(union acpi_object), &element}; struct acpi_buffer buffer = {0,NULL};
ACPI_FUNCTION_TRACE("acpi_evaluate_integer"); ACPI_FUNCTION_TRACE("acpi_evaluate_integer");
if (!data) if (!data)
return_ACPI_STATUS(AE_BAD_PARAMETER); return_ACPI_STATUS(AE_BAD_PARAMETER);
element = kmalloc(sizeof(union acpi_object), GFP_KERNEL);
if(!element)
return_ACPI_STATUS(AE_NO_MEMORY);
memset(element, 0, sizeof(union acpi_object));
buffer.length = sizeof(union acpi_object);
buffer.pointer = element;
status = acpi_evaluate_object(handle, pathname, arguments, &buffer); status = acpi_evaluate_object(handle, pathname, arguments, &buffer);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
acpi_util_eval_error(handle, pathname, status); acpi_util_eval_error(handle, pathname, status);
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
if (element.type != ACPI_TYPE_INTEGER) { if (element->type != ACPI_TYPE_INTEGER) {
acpi_util_eval_error(handle, pathname, AE_BAD_DATA); acpi_util_eval_error(handle, pathname, AE_BAD_DATA);
return_ACPI_STATUS(AE_BAD_DATA); return_ACPI_STATUS(AE_BAD_DATA);
} }
*data = element.integer.value; *data = element->integer.value;
kfree(element);
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Return value [%lu]\n", *data)); ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Return value [%lu]\n", *data));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment