diff options
Diffstat (limited to 'drivers/acpi/i2c_ec.c')
-rw-r--r-- | drivers/acpi/i2c_ec.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/acpi/i2c_ec.c b/drivers/acpi/i2c_ec.c index 82e3e64483fb..8338be0990bc 100644 --- a/drivers/acpi/i2c_ec.c +++ b/drivers/acpi/i2c_ec.c | |||
@@ -309,18 +309,16 @@ static int acpi_ec_hc_add(struct acpi_device *device) | |||
309 | return -EINVAL; | 309 | return -EINVAL; |
310 | } | 310 | } |
311 | 311 | ||
312 | ec_hc = kmalloc(sizeof(struct acpi_ec_hc), GFP_KERNEL); | 312 | ec_hc = kzalloc(sizeof(struct acpi_ec_hc), GFP_KERNEL); |
313 | if (!ec_hc) { | 313 | if (!ec_hc) { |
314 | return -ENOMEM; | 314 | return -ENOMEM; |
315 | } | 315 | } |
316 | memset(ec_hc, 0, sizeof(struct acpi_ec_hc)); | ||
317 | 316 | ||
318 | smbus = kmalloc(sizeof(struct acpi_ec_smbus), GFP_KERNEL); | 317 | smbus = kzalloc(sizeof(struct acpi_ec_smbus), GFP_KERNEL); |
319 | if (!smbus) { | 318 | if (!smbus) { |
320 | kfree(ec_hc); | 319 | kfree(ec_hc); |
321 | return -ENOMEM; | 320 | return -ENOMEM; |
322 | } | 321 | } |
323 | memset(smbus, 0, sizeof(struct acpi_ec_smbus)); | ||
324 | 322 | ||
325 | ec_hc->handle = device->handle; | 323 | ec_hc->handle = device->handle; |
326 | strcpy(acpi_device_name(device), ACPI_EC_HC_DEVICE_NAME); | 324 | strcpy(acpi_device_name(device), ACPI_EC_HC_DEVICE_NAME); |