]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit - drivers/dma/fsldma.c
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)
commit2e077f8e8337e52eef3c39c24c31e103b11a0326
tree686c9965c8304f5b6d59d3538e989674467ee129
parent776c8943f2766f2819fafd88fdfbaf418ecd6e41
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