Skip to content

Commit

Permalink
kfifo: fix a memory leak in dma example
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Andrea Righi authored and torvalds committed Aug 20, 2010
1 parent 7b34d52 commit d83a71c
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions samples/kfifo/dma-example.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d83a71c

Please sign in to comment.