Here's a patch with kfree() cleanups for drivers/firmware/efivars.c
Patch removes redundant NULL checks before kfree and also makes a small
whitespace cleanup - moves two statements on same line to sepperate lines.
Signed-off-by: Jesper Juhl <[email protected]>
---
drivers/firmware/efivars.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
--- linux-2.6.12-rc3-mm3-orig/drivers/firmware/efivars.c 2005-05-06 23:21:08.000000000 +0200
+++ linux-2.6.12-rc3-mm3/drivers/firmware/efivars.c 2005-05-09 00:08:51.000000000 +0200
@@ -618,8 +618,8 @@ efivar_create_sysfs_entry(unsigned long
new_efivar = kmalloc(sizeof(struct efivar_entry), GFP_KERNEL);
if (!short_name || !new_efivar) {
- if (short_name) kfree(short_name);
- if (new_efivar) kfree(new_efivar);
+ kfree(short_name);
+ kfree(new_efivar);
return 1;
}
memset(short_name, 0, short_name_size+1);
@@ -644,7 +644,8 @@ efivar_create_sysfs_entry(unsigned long
kobj_set_kset_s(new_efivar, vars_subsys);
kobject_register(&new_efivar->kobj);
- kfree(short_name); short_name = NULL;
+ kfree(short_name);
+ short_name = NULL;
spin_lock(&efivars_lock);
list_add(&new_efivar->list, &efivar_list);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]