X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=drivers%2Facpi%2Futils.c;h=68a809fa7b19d06ef9f9457120d05fdbbecdb9b2;hb=95006188cb1399f1358330503906e5891c129a10;hp=91fed70a65a6dbe946e2b3370bd40d9223600b90;hpb=706b75ddbe36d20d071424f9867385c319b67f8d;p=powerpc.git diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c index 91fed70a65..68a809fa7b 100644 --- a/drivers/acpi/utils.c +++ b/drivers/acpi/utils.c @@ -262,11 +262,10 @@ acpi_evaluate_integer(acpi_handle handle, if (!data) return AE_BAD_PARAMETER; - element = kmalloc(sizeof(union acpi_object), irqs_disabled() ? GFP_ATOMIC: GFP_KERNEL); + element = kzalloc(sizeof(union acpi_object), irqs_disabled() ? GFP_ATOMIC: GFP_KERNEL); if (!element) return 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); @@ -321,12 +320,11 @@ acpi_evaluate_string(acpi_handle handle, return AE_BAD_DATA; } - *data = kmalloc(element->string.length + 1, GFP_KERNEL); + *data = kzalloc(element->string.length + 1, GFP_KERNEL); if (!data) { printk(KERN_ERR PREFIX "Memory allocation\n"); return -ENOMEM; } - memset(*data, 0, element->string.length + 1); memcpy(*data, element->string.pointer, element->string.length);