diff options
Diffstat (limited to 'drivers/acpi/utils.c')
-rw-r--r-- | drivers/acpi/utils.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c index 91fed70a65a6..68a809fa7b19 100644 --- a/drivers/acpi/utils.c +++ b/drivers/acpi/utils.c | |||
@@ -262,11 +262,10 @@ acpi_evaluate_integer(acpi_handle handle, | |||
262 | if (!data) | 262 | if (!data) |
263 | return AE_BAD_PARAMETER; | 263 | return AE_BAD_PARAMETER; |
264 | 264 | ||
265 | element = kmalloc(sizeof(union acpi_object), irqs_disabled() ? GFP_ATOMIC: GFP_KERNEL); | 265 | element = kzalloc(sizeof(union acpi_object), irqs_disabled() ? GFP_ATOMIC: GFP_KERNEL); |
266 | if (!element) | 266 | if (!element) |
267 | return AE_NO_MEMORY; | 267 | return AE_NO_MEMORY; |
268 | 268 | ||
269 | memset(element, 0, sizeof(union acpi_object)); | ||
270 | buffer.length = sizeof(union acpi_object); | 269 | buffer.length = sizeof(union acpi_object); |
271 | buffer.pointer = element; | 270 | buffer.pointer = element; |
272 | status = acpi_evaluate_object(handle, pathname, arguments, &buffer); | 271 | status = acpi_evaluate_object(handle, pathname, arguments, &buffer); |
@@ -321,12 +320,11 @@ acpi_evaluate_string(acpi_handle handle, | |||
321 | return AE_BAD_DATA; | 320 | return AE_BAD_DATA; |
322 | } | 321 | } |
323 | 322 | ||
324 | *data = kmalloc(element->string.length + 1, GFP_KERNEL); | 323 | *data = kzalloc(element->string.length + 1, GFP_KERNEL); |
325 | if (!data) { | 324 | if (!data) { |
326 | printk(KERN_ERR PREFIX "Memory allocation\n"); | 325 | printk(KERN_ERR PREFIX "Memory allocation\n"); |
327 | return -ENOMEM; | 326 | return -ENOMEM; |
328 | } | 327 | } |
329 | memset(*data, 0, element->string.length + 1); | ||
330 | 328 | ||
331 | memcpy(*data, element->string.pointer, element->string.length); | 329 | memcpy(*data, element->string.pointer, element->string.length); |
332 | 330 | ||