aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/firmware/efivars.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c
index a3451cb94004..33b17c6a46fb 100644
--- a/drivers/firmware/efivars.c
+++ b/drivers/firmware/efivars.c
@@ -618,8 +618,8 @@ efivar_create_sysfs_entry(unsigned long variable_name_size,
618 new_efivar = kmalloc(sizeof(struct efivar_entry), GFP_KERNEL); 618 new_efivar = kmalloc(sizeof(struct efivar_entry), GFP_KERNEL);
619 619
620 if (!short_name || !new_efivar) { 620 if (!short_name || !new_efivar) {
621 if (short_name) kfree(short_name); 621 kfree(short_name);
622 if (new_efivar) kfree(new_efivar); 622 kfree(new_efivar);
623 return 1; 623 return 1;
624 } 624 }
625 memset(short_name, 0, short_name_size+1); 625 memset(short_name, 0, short_name_size+1);
@@ -644,7 +644,8 @@ efivar_create_sysfs_entry(unsigned long variable_name_size,
644 kobj_set_kset_s(new_efivar, vars_subsys); 644 kobj_set_kset_s(new_efivar, vars_subsys);
645 kobject_register(&new_efivar->kobj); 645 kobject_register(&new_efivar->kobj);
646 646
647 kfree(short_name); short_name = NULL; 647 kfree(short_name);
648 short_name = NULL;
648 649
649 spin_lock(&efivars_lock); 650 spin_lock(&efivars_lock);
650 list_add(&new_efivar->list, &efivar_list); 651 list_add(&new_efivar->list, &efivar_list);