diff options
Diffstat (limited to 'drivers/acpi/utilities/utcopy.c')
| -rw-r--r-- | drivers/acpi/utilities/utcopy.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/drivers/acpi/utilities/utcopy.c b/drivers/acpi/utilities/utcopy.c index 47875935c3f4..371cddc0d574 100644 --- a/drivers/acpi/utilities/utcopy.c +++ b/drivers/acpi/utilities/utcopy.c | |||
| @@ -472,8 +472,8 @@ acpi_ut_copy_esimple_to_isimple(union acpi_object *external_object, | |||
| 472 | case ACPI_TYPE_STRING: | 472 | case ACPI_TYPE_STRING: |
| 473 | 473 | ||
| 474 | internal_object->string.pointer = | 474 | internal_object->string.pointer = |
| 475 | ACPI_MEM_CALLOCATE((acpi_size) external_object->string. | 475 | ACPI_ALLOCATE_ZEROED((acpi_size) external_object->string. |
| 476 | length + 1); | 476 | length + 1); |
| 477 | if (!internal_object->string.pointer) { | 477 | if (!internal_object->string.pointer) { |
| 478 | goto error_exit; | 478 | goto error_exit; |
| 479 | } | 479 | } |
| @@ -488,7 +488,7 @@ acpi_ut_copy_esimple_to_isimple(union acpi_object *external_object, | |||
| 488 | case ACPI_TYPE_BUFFER: | 488 | case ACPI_TYPE_BUFFER: |
| 489 | 489 | ||
| 490 | internal_object->buffer.pointer = | 490 | internal_object->buffer.pointer = |
| 491 | ACPI_MEM_CALLOCATE(external_object->buffer.length); | 491 | ACPI_ALLOCATE_ZEROED(external_object->buffer.length); |
| 492 | if (!internal_object->buffer.pointer) { | 492 | if (!internal_object->buffer.pointer) { |
| 493 | goto error_exit; | 493 | goto error_exit; |
| 494 | } | 494 | } |
| @@ -676,7 +676,7 @@ acpi_ut_copy_simple_object(union acpi_operand_object *source_desc, | |||
| 676 | if ((source_desc->buffer.pointer) && | 676 | if ((source_desc->buffer.pointer) && |
| 677 | (source_desc->buffer.length)) { | 677 | (source_desc->buffer.length)) { |
| 678 | dest_desc->buffer.pointer = | 678 | dest_desc->buffer.pointer = |
| 679 | ACPI_MEM_ALLOCATE(source_desc->buffer.length); | 679 | ACPI_ALLOCATE(source_desc->buffer.length); |
| 680 | if (!dest_desc->buffer.pointer) { | 680 | if (!dest_desc->buffer.pointer) { |
| 681 | return (AE_NO_MEMORY); | 681 | return (AE_NO_MEMORY); |
| 682 | } | 682 | } |
| @@ -697,8 +697,8 @@ acpi_ut_copy_simple_object(union acpi_operand_object *source_desc, | |||
| 697 | */ | 697 | */ |
| 698 | if (source_desc->string.pointer) { | 698 | if (source_desc->string.pointer) { |
| 699 | dest_desc->string.pointer = | 699 | dest_desc->string.pointer = |
| 700 | ACPI_MEM_ALLOCATE((acpi_size) source_desc->string. | 700 | ACPI_ALLOCATE((acpi_size) source_desc->string. |
| 701 | length + 1); | 701 | length + 1); |
| 702 | if (!dest_desc->string.pointer) { | 702 | if (!dest_desc->string.pointer) { |
| 703 | return (AE_NO_MEMORY); | 703 | return (AE_NO_MEMORY); |
| 704 | } | 704 | } |
| @@ -805,9 +805,7 @@ acpi_ut_copy_ielement_to_ielement(u8 object_type, | |||
| 805 | /* | 805 | /* |
| 806 | * Create the object array | 806 | * Create the object array |
| 807 | */ | 807 | */ |
| 808 | target_object->package.elements = | 808 | target_object->package.elements = ACPI_ALLOCATE_ZEROED(((acpi_size) source_object->package.count + 1) * sizeof(void *)); |
| 809 | ACPI_MEM_CALLOCATE(((acpi_size) source_object->package. | ||
| 810 | count + 1) * sizeof(void *)); | ||
| 811 | if (!target_object->package.elements) { | 809 | if (!target_object->package.elements) { |
| 812 | status = AE_NO_MEMORY; | 810 | status = AE_NO_MEMORY; |
| 813 | goto error_exit; | 811 | goto error_exit; |
| @@ -865,10 +863,10 @@ acpi_ut_copy_ipackage_to_ipackage(union acpi_operand_object *source_obj, | |||
| 865 | /* | 863 | /* |
| 866 | * Create the object array and walk the source package tree | 864 | * Create the object array and walk the source package tree |
| 867 | */ | 865 | */ |
| 868 | dest_obj->package.elements = ACPI_MEM_CALLOCATE(((acpi_size) | 866 | dest_obj->package.elements = ACPI_ALLOCATE_ZEROED(((acpi_size) |
| 869 | source_obj->package. | 867 | source_obj->package. |
| 870 | count + | 868 | count + |
| 871 | 1) * sizeof(void *)); | 869 | 1) * sizeof(void *)); |
| 872 | if (!dest_obj->package.elements) { | 870 | if (!dest_obj->package.elements) { |
| 873 | ACPI_ERROR((AE_INFO, "Package allocation failure")); | 871 | ACPI_ERROR((AE_INFO, "Package allocation failure")); |
| 874 | return_ACPI_STATUS(AE_NO_MEMORY); | 872 | return_ACPI_STATUS(AE_NO_MEMORY); |
