aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/ec.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/ec.c')
-rw-r--r--drivers/acpi/ec.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index 08c12588af69..9c52d87d6f04 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -624,10 +624,9 @@ static int acpi_ec_add(struct acpi_device *device)
624 if (!device) 624 if (!device)
625 return -EINVAL; 625 return -EINVAL;
626 626
627 ec = kmalloc(sizeof(struct acpi_ec), GFP_KERNEL); 627 ec = kzalloc(sizeof(struct acpi_ec), GFP_KERNEL);
628 if (!ec) 628 if (!ec)
629 return -ENOMEM; 629 return -ENOMEM;
630 memset(ec, 0, sizeof(struct acpi_ec));
631 630
632 ec->handle = device->handle; 631 ec->handle = device->handle;
633 ec->uid = -1; 632 ec->uid = -1;
@@ -848,12 +847,11 @@ static int __init acpi_ec_fake_ecdt(void)
848 847
849 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Try to make an fake ECDT")); 848 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Try to make an fake ECDT"));
850 849
851 ec_ecdt = kmalloc(sizeof(struct acpi_ec), GFP_KERNEL); 850 ec_ecdt = kzalloc(sizeof(struct acpi_ec), GFP_KERNEL);
852 if (!ec_ecdt) { 851 if (!ec_ecdt) {
853 ret = -ENOMEM; 852 ret = -ENOMEM;
854 goto error; 853 goto error;
855 } 854 }
856 memset(ec_ecdt, 0, sizeof(struct acpi_ec));
857 855
858 status = acpi_get_devices(ACPI_EC_HID, 856 status = acpi_get_devices(ACPI_EC_HID,
859 acpi_fake_ecdt_callback, NULL, NULL); 857 acpi_fake_ecdt_callback, NULL, NULL);
@@ -885,10 +883,9 @@ static int __init acpi_ec_get_real_ecdt(void)
885 /* 883 /*
886 * Generate a temporary ec context to use until the namespace is scanned 884 * Generate a temporary ec context to use until the namespace is scanned
887 */ 885 */
888 ec_ecdt = kmalloc(sizeof(struct acpi_ec), GFP_KERNEL); 886 ec_ecdt = kzalloc(sizeof(struct acpi_ec), GFP_KERNEL);
889 if (!ec_ecdt) 887 if (!ec_ecdt)
890 return -ENOMEM; 888 return -ENOMEM;
891 memset(ec_ecdt, 0, sizeof(struct acpi_ec));
892 889
893 mutex_init(&ec_ecdt->lock); 890 mutex_init(&ec_ecdt->lock);
894 if (acpi_ec_mode == EC_INTR) { 891 if (acpi_ec_mode == EC_INTR) {