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);
On Mon, May 09, 2005 at 12:15:12AM +0200, Jesper Juhl wrote:
> 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]>
Ack'd-by: Matt Domsch <[email protected]>
Thanks,
Matt
--
Matt Domsch
Software Architect
Dell Linux Solutions linux.dell.com & http://www.dell.com/linux
Linux on Dell mailing lists @ http://lists.us.dell.com