All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Small kfree cleanup, save a local variable.
@ 2005-06-19 19:38 Jesper Juhl
  2005-06-19 19:37 ` Michael Buesch
  2005-06-19 20:13 ` Chris Wright
  0 siblings, 2 replies; 6+ messages in thread
From: Jesper Juhl @ 2005-06-19 19:38 UTC (permalink / raw)
  To: linux-kernel; +Cc: Rickard E. (Rik) Faith, Rik Faith

Here's a patch with a small improvement to kernel/auditsc.c .
There's no need for the local variable  struct audit_entry *e  , 
we can just call kfree directly on container_of() .
Patch also removes an extra space a little further down in the file.

Signed-off-by: Jesper Juhl <juhl-lkml@dif.dk>
---

 kernel/auditsc.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

--- linux-2.6.12-orig/kernel/auditsc.c	2005-06-17 21:48:29.000000000 +0200
+++ linux-2.6.12/kernel/auditsc.c	2005-06-19 21:21:37.000000000 +0200
@@ -202,8 +202,7 @@ static inline int audit_add_rule(struct 
 
 static void audit_free_rule(struct rcu_head *head)
 {
-	struct audit_entry *e = container_of(head, struct audit_entry, rcu);
-	kfree(e);
+	kfree(container_of(head, struct audit_entry, rcu));
 }
 
 /* Note that audit_add_rule and audit_del_rule are called via
@@ -612,7 +611,7 @@ static inline void audit_free_context(st
 		audit_free_names(context);
 		audit_free_aux(context);
 		kfree(context);
-		context  = previous;
+		context = previous;
 	} while (context);
 	if (count >= 10)
 		printk(KERN_ERR "audit: freed %d contexts\n", count);



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

end of thread, other threads:[~2005-06-19 20:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-19 19:38 [PATCH] Small kfree cleanup, save a local variable Jesper Juhl
2005-06-19 19:37 ` Michael Buesch
2005-06-19 19:49   ` Jesper Juhl
2005-06-19 20:13 ` Chris Wright
2005-06-19 20:19   ` Jesper Juhl
2005-06-19 20:20     ` Chris Wright

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.