diff options
author | Ludovic Desroches <ludovic.desroches@atmel.com> | 2015-09-15 09:38:24 -0400 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2015-09-30 22:00:56 -0400 |
commit | 62b5cb757f1d6c875293958535952dd38ff9e675 (patch) | |
tree | e050298e04d5e4873b4a0064790a1e42199932cc /drivers/dma/at_xdmac.c | |
parent | 4e5385784e69e448efca0998aa188404d5e8d313 (diff) |
dmaengine: at_xdmac: fix memory leak in interleaved mode
In interleaved mode, when numf > 1, we have only one descriptor for the
transfer but this descriptor has to be added to the descs_list. If not,
when doing remove_xfer, the descriptor won't be put back in the
free_descs_list.
Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma/at_xdmac.c')
-rw-r--r-- | drivers/dma/at_xdmac.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/dma/at_xdmac.c b/drivers/dma/at_xdmac.c index 0190d1ca3004..2ab6fe7339e6 100644 --- a/drivers/dma/at_xdmac.c +++ b/drivers/dma/at_xdmac.c | |||
@@ -958,6 +958,10 @@ at_xdmac_prep_interleaved(struct dma_chan *chan, | |||
958 | xt, xt->sgl); | 958 | xt, xt->sgl); |
959 | for (i = 0; i < xt->numf; i++) | 959 | for (i = 0; i < xt->numf; i++) |
960 | at_xdmac_increment_block_count(chan, first); | 960 | at_xdmac_increment_block_count(chan, first); |
961 | |||
962 | dev_dbg(chan2dev(chan), "%s: add desc 0x%p to descs_list 0x%p\n", | ||
963 | __func__, first, first); | ||
964 | list_add_tail(&first->desc_node, &first->descs_list); | ||
961 | } else { | 965 | } else { |
962 | for (i = 0; i < xt->frame_size; i++) { | 966 | for (i = 0; i < xt->frame_size; i++) { |
963 | size_t src_icg = 0, dst_icg = 0; | 967 | size_t src_icg = 0, dst_icg = 0; |