aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/ac.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/ac.c')
-rw-r--r--drivers/acpi/ac.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c
index 46e58663dcb5..6daeace796a8 100644
--- a/drivers/acpi/ac.c
+++ b/drivers/acpi/ac.c
@@ -221,10 +221,9 @@ static int acpi_ac_add(struct acpi_device *device)
221 if (!device) 221 if (!device)
222 return -EINVAL; 222 return -EINVAL;
223 223
224 ac = kmalloc(sizeof(struct acpi_ac), GFP_KERNEL); 224 ac = kzalloc(sizeof(struct acpi_ac), GFP_KERNEL);
225 if (!ac) 225 if (!ac)
226 return -ENOMEM; 226 return -ENOMEM;
227 memset(ac, 0, sizeof(struct acpi_ac));
228 227
229 ac->device = device; 228 ac->device = device;
230 strcpy(acpi_device_name(device), ACPI_AC_DEVICE_NAME); 229 strcpy(acpi_device_name(device), ACPI_AC_DEVICE_NAME);