diff options
author | Deepak Saxena <dsaxena@plexity.net> | 2005-11-07 01:01:24 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-07 07:54:00 -0800 |
commit | 9c2153844d72ac92b6da0ee42f7f81fb0aa91f8a (patch) | |
tree | 77da7b9ea21ae365273973a20c1cec349c570f22 /drivers/firmware/efivars.c | |
parent | 49d0c6039dd36791cad36624e68bce5fe011bf12 (diff) | |
download | op-kernel-dev-9c2153844d72ac92b6da0ee42f7f81fb0aa91f8a.zip op-kernel-dev-9c2153844d72ac92b6da0ee42f7f81fb0aa91f8a.tar.gz |
[PATCH] drivers/firmware: kmalloc + memset -> kzalloc conversion
Signed-off-by: Deepak Saxena <dsaxena@plexity.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/firmware/efivars.c')
-rw-r--r-- | drivers/firmware/efivars.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c index 33b17c6..bda5bce 100644 --- a/drivers/firmware/efivars.c +++ b/drivers/firmware/efivars.c @@ -614,16 +614,14 @@ efivar_create_sysfs_entry(unsigned long variable_name_size, char *short_name; struct efivar_entry *new_efivar; - short_name = kmalloc(short_name_size + 1, GFP_KERNEL); - new_efivar = kmalloc(sizeof(struct efivar_entry), GFP_KERNEL); + short_name = kzalloc(short_name_size + 1, GFP_KERNEL); + new_efivar = kzalloc(sizeof(struct efivar_entry), GFP_KERNEL); if (!short_name || !new_efivar) { kfree(short_name); kfree(new_efivar); return 1; } - memset(short_name, 0, short_name_size+1); - memset(new_efivar, 0, sizeof(struct efivar_entry)); memcpy(new_efivar->var.VariableName, variable_name, variable_name_size); @@ -674,14 +672,12 @@ efivars_init(void) if (!efi_enabled) return -ENODEV; - variable_name = kmalloc(variable_name_size, GFP_KERNEL); + variable_name = kzalloc(variable_name_size, GFP_KERNEL); if (!variable_name) { printk(KERN_ERR "efivars: Memory allocation failed.\n"); return -ENOMEM; } - memset(variable_name, 0, variable_name_size); - printk(KERN_INFO "EFI Variables Facility v%s %s\n", EFIVARS_VERSION, EFIVARS_DATE); |