aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/container.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/container.c')
-rw-r--r--drivers/acpi/container.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/acpi/container.c b/drivers/acpi/container.c
index 871aa520ece7..0a1863ec91f3 100644
--- a/drivers/acpi/container.c
+++ b/drivers/acpi/container.c
@@ -96,11 +96,10 @@ static int acpi_container_add(struct acpi_device *device)
96 return -EINVAL; 96 return -EINVAL;
97 } 97 }
98 98
99 container = kmalloc(sizeof(struct acpi_container), GFP_KERNEL); 99 container = kzalloc(sizeof(struct acpi_container), GFP_KERNEL);
100 if (!container) 100 if (!container)
101 return -ENOMEM; 101 return -ENOMEM;
102 102
103 memset(container, 0, sizeof(struct acpi_container));
104 container->handle = device->handle; 103 container->handle = device->handle;
105 strcpy(acpi_device_name(device), ACPI_CONTAINER_DEVICE_NAME); 104 strcpy(acpi_device_name(device), ACPI_CONTAINER_DEVICE_NAME);
106 strcpy(acpi_device_class(device), ACPI_CONTAINER_CLASS); 105 strcpy(acpi_device_class(device), ACPI_CONTAINER_CLASS);
@@ -117,7 +116,7 @@ static int acpi_container_remove(struct acpi_device *device, int type)
117 acpi_status status = AE_OK; 116 acpi_status status = AE_OK;
118 struct acpi_container *pc = NULL; 117 struct acpi_container *pc = NULL;
119 118
120 pc = (struct acpi_container *)acpi_driver_data(device); 119 pc = acpi_driver_data(device);
121 kfree(pc); 120 kfree(pc);
122 return status; 121 return status;
123} 122}