Re: [PATCH 2/3] kfifo: fix a memory leak in dma example

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Stefani Seibold
Date: Friday, August 13, 2010 - 1:42 pm

We use a dynamically allocated kfifo in the dma example, so we need to
free it when unloading the module.

Signed-off-by: Andrea Righi <arighi@develer.com>
Acked-by: Stefani Seibold <stefani@seibold.net>
---
 samples/kfifo/dma-example.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/samples/kfifo/dma-example.c b/samples/kfifo/dma-example.c
index 03433ca..3682278 100644
--- a/samples/kfifo/dma-example.c
+++ b/samples/kfifo/dma-example.c
@@ -105,9 +105,7 @@ static int __init example_init(void)
 
 static void __exit example_exit(void)
 {
-#ifdef DYNAMIC
-	kfifo_free(&test);
-#endif
+	kfifo_free(&fifo);
 }
 
 module_init(example_init);


--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 1/3] kfifo: fix kernel BUG in dma example, Andrea Righi, (Fri Aug 13, 12:59 pm)
[PATCH 2/3] kfifo: fix a memory leak in dma example, Andrea Righi, (Fri Aug 13, 12:59 pm)
Re: [PATCH 1/3] kfifo: fix kernel BUG in dma example, Stefani Seibold, (Fri Aug 13, 1:40 pm)
Re: [PATCH 2/3] kfifo: fix a memory leak in dma example, Stefani Seibold, (Fri Aug 13, 1:42 pm)