diff options
Diffstat (limited to 'drivers/acpi/acpi_memhotplug.c')
-rw-r--r-- | drivers/acpi/acpi_memhotplug.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c index 6bcd9e8e7bcb..cd946ed192d3 100644 --- a/drivers/acpi/acpi_memhotplug.c +++ b/drivers/acpi/acpi_memhotplug.c | |||
@@ -395,10 +395,9 @@ static int acpi_memory_device_add(struct acpi_device *device) | |||
395 | if (!device) | 395 | if (!device) |
396 | return -EINVAL; | 396 | return -EINVAL; |
397 | 397 | ||
398 | mem_device = kmalloc(sizeof(struct acpi_memory_device), GFP_KERNEL); | 398 | mem_device = kzalloc(sizeof(struct acpi_memory_device), GFP_KERNEL); |
399 | if (!mem_device) | 399 | if (!mem_device) |
400 | return -ENOMEM; | 400 | return -ENOMEM; |
401 | memset(mem_device, 0, sizeof(struct acpi_memory_device)); | ||
402 | 401 | ||
403 | INIT_LIST_HEAD(&mem_device->res_list); | 402 | INIT_LIST_HEAD(&mem_device->res_list); |
404 | mem_device->device = device; | 403 | mem_device->device = device; |
@@ -429,7 +428,7 @@ static int acpi_memory_device_remove(struct acpi_device *device, int type) | |||
429 | if (!device || !acpi_driver_data(device)) | 428 | if (!device || !acpi_driver_data(device)) |
430 | return -EINVAL; | 429 | return -EINVAL; |
431 | 430 | ||
432 | mem_device = (struct acpi_memory_device *)acpi_driver_data(device); | 431 | mem_device = acpi_driver_data(device); |
433 | kfree(mem_device); | 432 | kfree(mem_device); |
434 | 433 | ||
435 | return 0; | 434 | return 0; |