dmaengine: apple-admac: Fix 'current_tx' not getting freed
authorMartin Povišer <povik+lin@cutebit.org>
Fri, 24 Feb 2023 15:22:21 +0000 (16:22 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 20 Apr 2023 10:35:08 +0000 (12:35 +0200)
commitb7abd535881a48587961c2099b1d2933ebd42c4b
tree584c72a1982ffbc3bc4bce6aa523f0fe2e27d4c4
parentfdbd0392352c3defc74e58795eb0e8b61907f413
dmaengine: apple-admac: Fix 'current_tx' not getting freed

[ Upstream commit d9503be5a100c553731c0e8a82c7b4201e8a970c ]

In terminate_all we should queue up all submitted descriptors to be
freed. We do that for the content of the 'issued' and 'submitted' lists,
but the 'current_tx' descriptor falls through the cracks as it's
removed from the 'issued' list once it gets assigned to be the current
descriptor. Explicitly queue up freeing of the 'current_tx' descriptor
to address a memory leak that is otherwise present.

Fixes: b127315d9a78 ("dmaengine: apple-admac: Add Apple ADMAC driver")
Signed-off-by: Martin Povišer <povik+lin@cutebit.org>
Link: https://lore.kernel.org/r/20230224152222.26732-2-povik+lin@cutebit.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/dma/apple-admac.c