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

From: Stefani Seibold
Date: Fri Aug 13 2010 - 16:42:38 EST


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@xxxxxxxxxxx>
Acked-by: Stefani Seibold <stefani@xxxxxxxxxxx>
---
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);


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/