diff options
author | Burman Yan <yan_952@hotmail.com> | 2006-12-19 15:56:11 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2006-12-20 16:54:54 -0500 |
commit | 36bcbec7ce21e2e8b3143b11a05747330abeca70 (patch) | |
tree | d9ace4d83a5013dbb3cd599e7bc4358ce4cdb980 /drivers/acpi/utils.c | |
parent | 5b7b4119553dd7cc0bc200c0d1b1598e158eec9a (diff) |
ACPI: replace kmalloc+memset with kzalloc
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Len Brown <len.brown@intel.com>
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 | ||