]> git.baikalelectronics.ru Git - kernel.git/commit
dmaengine: imx-sdma: Fix memory leak
authorSascha Hauer <s.hauer@pengutronix.de>
Mon, 16 Dec 2019 10:53:28 +0000 (11:53 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 24 Feb 2020 07:36:40 +0000 (08:36 +0100)
commit8b6a1f5b18bb1ab3be2834fbab9d94c0c141285e
treeb27fa18a4e9cf957161f1a262e98d7e6de683fc0
parentabf1f17250d041a860edcbe972d702bd500ea78a
dmaengine: imx-sdma: Fix memory leak

[ Upstream commit 1cf728fb653031337e9673a3a132354631b31b7f ]

The current descriptor is not on any list of the virtual DMA channel.
Once sdma_terminate_all() is called when a descriptor is currently
in flight then this one is forgotten to be freed. We have to call
vchan_terminate_vdesc() on this descriptor to re-add it to the lists.
Now that we also free the currently running descriptor we can (and
actually have to) remove the current descriptor from its list also
for the cyclic case.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reviewed-by: Robin Gong <yibin.gong@nxp.com>
Tested-by: Robin Gong <yibin.gong@nxp.com>
Link: https://lore.kernel.org/r/20191216105328.15198-10-s.hauer@pengutronix.de
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/dma/imx-sdma.c