]> git.baikalelectronics.ru Git - kernel.git/commit
fsldma: fix memory leak on error path in fsl_dma_prep_memcpy()
authorIra Snyder <iws@ovro.caltech.edu>
Fri, 15 May 2009 16:59:46 +0000 (09:59 -0700)
committerLi Yang <leoli@freescale.com>
Fri, 22 May 2009 08:54:42 +0000 (16:54 +0800)
commit0121b93f9e2431d2ce9e2a802c41468bdfa71efa
tree686c9965c8304f5b6d59d3538e989674467ee129
parent9d4ebab313d792c3f0f24e229b9d4ee57e9825e2
fsldma: fix memory leak on error path in fsl_dma_prep_memcpy()

When preparing a memcpy operation, if the kernel fails to allocate memory
for a link descriptor after the first link descriptor has already been
allocated, then some memory will never be released. Fix the problem by
walking the list of allocated descriptors backwards, and freeing the
allocated descriptors back into the DMA pool.

Signed-off-by: Ira W. Snyder <iws@ovro.caltech.edu>
Signed-off-by: Li Yang <leoli@freescale.com>
drivers/dma/fsldma.c