dmaengine: Fix oops on dmatest module unload.
PATCH 1/1 dmaengine: Fix oops on dmatest module unload.
This patch fixes an oops that happens when the dmatest module is unloaded. The dma_release_channel() function is called on channels that have already been cleaned up (and therefore freed) with dmatest_cleanup_channel().
--- drivers/dma/dmatest.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/dma/dmatest.c +1 -1
@@ -433,10 +433,10 @@ static void __exit dmatest_exit(void)list_for_each_entry_safe (dtc, _dtc, &dmatest_channels, node) {list_del (&dtc->node); +dma_release_channel (dtc->chan);dmatest_cleanup_channel (dtc);pr_debug ("dmatest: dropped channel %s\n" ,dma_chan_name (dtc->chan)); -dma_release_channel (dtc->chan); } }module_exit (dmatest_exit);
Signature · 1 line
tg: (8e49215..) adx/dma (depends on: adx/master)
Quoted 3 lines · Thierry Reding
This patch fixes an oops that happens when the dmatest module is unloaded. The
dma_release_channel()function is called on channels that have already been cleaned up (and therefore freed) withdmatest_cleanup_channel().
...
drivers/dma/dmatest.c static void __exit dmatest_exit(void) · line 441
Quoted 11 lines
drivers/dma/dmatest.c +1
-1@@ -433,10 +433,10 @@ static void __exit dmatest_exit(void)list_for_each_entry_safe (dtc, _dtc, &dmatest_channels, node) {list_del (&dtc->node); +dma_release_channel (dtc->chan);dmatest_cleanup_channel (dtc);pr_debug ("dmatest: dropped channel %s\n" ,dma_chan_name (dtc->chan)); -dma_release_channel (dtc->chan); } }
Good catch! Please move pr_debug() too.
---
Atsushi Nemoto
PATCH v2 1/1 dmaengine: Fix oops on dmatest module unload.
This patch fixes an oops that happens when the dmatest module is unloaded. The dma_release_channel() function is called on channels that have already been cleaned up (and therefore freed) with dmatest_cleanup_channel().
--- drivers/dma/dmatest.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/dma/dmatest.c +1 -1
@@ -433,10 +433,10 @@ static void __exit dmatest_exit(void)list_for_each_entry_safe (dtc, _dtc, &dmatest_channels, node) {list_del (&dtc->node); -dmatest_cleanup_channel (dtc);pr_debug ("dmatest: dropped channel %s\n" ,dma_chan_name (dtc->chan));dma_release_channel (dtc->chan); +dmatest_cleanup_channel (dtc); } }module_exit (dmatest_exit);
Signature · 1 line
tg: (8e49215..) adx/dma (depends on: adx/master)
Dan Williams
AppliedQuoted 5 lines · Thierry Reding
This patch fixes an oops that happens when the dmatest module is unloaded. The
dma_release_channel()function is called on channels that have already been cleaned up (and therefore freed) withdmatest_cleanup_channel().Signed-off-by Thierry Reding <[email protected]>
Thanks, applied with Atsushi's ack.
Quoted 10 lines · Dan Williams
Quoted 5 lines · Thierry Reding
This patch fixes an oops that happens when the dmatest module is unloaded. The
dma_release_channel()function is called on channels that have already been cleaned up (and therefore freed) withdmatest_cleanup_channel().Signed-off-by Thierry Reding <[email protected]>Thanks, applied with Atsushi's ack.
...and now it is unapplied :-). The problem with this patch is that it releases the channel before dmatest is done with it. 'Cleanup' followed by 'release' is the right order, just need to save ->chan before it gets freed.
--
Dan
Quoted 4 lines · Dan Williams
...and now it is unapplied :-). The problem with this patch is that it releases the channel before dmatest is done with it. 'Cleanup' followed by 'release' is the right order, just need to save ->chan before it gets freed.
Oh that's right. I tested your fix in async_tx tree and it works fine. Thanks!
---
Atsushi Nemoto