aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firmware
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/firmware')
-rw-r--r--drivers/firmware/edd.c3
-rw-r--r--drivers/firmware/efivars.c10
2 files changed, 4 insertions, 9 deletions
diff --git a/drivers/firmware/edd.c b/drivers/firmware/edd.c
index 6996476669f1..b4502ed65793 100644
--- a/drivers/firmware/edd.c
+++ b/drivers/firmware/edd.c
@@ -715,7 +715,6 @@ edd_device_register(struct edd_device *edev, int i)
715 715
716 if (!edev) 716 if (!edev)
717 return 1; 717 return 1;
718 memset(edev, 0, sizeof (*edev));
719 edd_dev_set_info(edev, i); 718 edd_dev_set_info(edev, i);
720 kobject_set_name(&edev->kobj, "int13_dev%02x", 719 kobject_set_name(&edev->kobj, "int13_dev%02x",
721 0x80 + i); 720 0x80 + i);
@@ -756,7 +755,7 @@ edd_init(void)
756 return rc; 755 return rc;
757 756
758 for (i = 0; i < edd_num_devices() && !rc; i++) { 757 for (i = 0; i < edd_num_devices() && !rc; i++) {
759 edev = kmalloc(sizeof (*edev), GFP_KERNEL); 758 edev = kzalloc(sizeof (*edev), GFP_KERNEL);
760 if (!edev) 759 if (!edev)
761 return -ENOMEM; 760 return -ENOMEM;
762 761
diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c
index 33b17c6a46fb..bda5bce681b6 100644
--- a/drivers/firmware/efivars.c
+++ b/drivers/firmware/efivars.c
@@ -614,16 +614,14 @@ efivar_create_sysfs_entry(unsigned long variable_name_size,
614 char *short_name; 614 char *short_name;
615 struct efivar_entry *new_efivar; 615 struct efivar_entry *new_efivar;
616 616
617 short_name = kmalloc(short_name_size + 1, GFP_KERNEL); 617 short_name = kzalloc(short_name_size + 1, GFP_KERNEL);
618 new_efivar = kmalloc(sizeof(struct efivar_entry), GFP_KERNEL); 618 new_efivar = kzalloc(sizeof(struct efivar_entry), GFP_KERNEL);
619 619
620 if (!short_name || !new_efivar) { 620 if (!short_name || !new_efivar) {
621 kfree(short_name); 621 kfree(short_name);
622 kfree(new_efivar); 622 kfree(new_efivar);
623 return 1; 623 return 1;
624 } 624 }
625 memset(short_name, 0, short_name_size+1);
626 memset(new_efivar, 0, sizeof(struct efivar_entry));
627 625
628 memcpy(new_efivar->var.VariableName, variable_name, 626 memcpy(new_efivar->var.VariableName, variable_name,
629 variable_name_size); 627 variable_name_size);
@@ -674,14 +672,12 @@ efivars_init(void)
674 if (!efi_enabled) 672 if (!efi_enabled)
675 return -ENODEV; 673 return -ENODEV;
676 674
677 variable_name = kmalloc(variable_name_size, GFP_KERNEL); 675 variable_name = kzalloc(variable_name_size, GFP_KERNEL);
678 if (!variable_name) { 676 if (!variable_name) {
679 printk(KERN_ERR "efivars: Memory allocation failed.\n"); 677 printk(KERN_ERR "efivars: Memory allocation failed.\n");
680 return -ENOMEM; 678 return -ENOMEM;
681 } 679 }
682 680
683 memset(variable_name, 0, variable_name_size);
684
685 printk(KERN_INFO "EFI Variables Facility v%s %s\n", EFIVARS_VERSION, 681 printk(KERN_INFO "EFI Variables Facility v%s %s\n", EFIVARS_VERSION,
686 EFIVARS_DATE); 682 EFIVARS_DATE);
687 683