linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kfree cleanups for drivers/firmware/
@ 2005-05-08 22:15 Jesper Juhl
  2005-05-09  4:15 ` Matt Domsch
  0 siblings, 1 reply; 2+ messages in thread
From: Jesper Juhl @ 2005-05-08 22:15 UTC (permalink / raw)
  To: linux-kernel; +Cc: Matt_Domsch, matthew.e.tolentino, akpm

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 <juhl-lkml@dif.dk>
---

 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);



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] kfree cleanups for drivers/firmware/
  2005-05-08 22:15 [PATCH] kfree cleanups for drivers/firmware/ Jesper Juhl
@ 2005-05-09  4:15 ` Matt Domsch
  0 siblings, 0 replies; 2+ messages in thread
From: Matt Domsch @ 2005-05-09  4:15 UTC (permalink / raw)
  To: Jesper Juhl; +Cc: linux-kernel, matthew.e.tolentino, akpm

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 <juhl-lkml@dif.dk>

Ack'd-by: Matt Domsch <Matt_Domsch@dell.com>

Thanks,
Matt

-- 
Matt Domsch
Software Architect
Dell Linux Solutions linux.dell.com & www.dell.com/linux
Linux on Dell mailing lists @ http://lists.us.dell.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-05-09  4:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-08 22:15 [PATCH] kfree cleanups for drivers/firmware/ Jesper Juhl
2005-05-09  4:15 ` Matt Domsch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).