kfifo: fix a memory leak in dma example
authorAndrea Righi <[email protected]>
Thu, 19 Aug 2010 21:13:30 +0000 (14:13 -0700)
committerLinus Torvalds <[email protected]>
Fri, 20 Aug 2010 16:34:54 +0000 (09:34 -0700)
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 <[email protected]>
Acked-by: Stefani Seibold <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
samples/kfifo/dma-example.c

index 03433ca5bdadeeba348b7c5436ee2f3fae28b5d4..3682278785f7e5610c1034a102724882791e6946 100644 (file)
@@ -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);