]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
dmaengine: fsl-edma: implement the cleanup path of fsl_edma3_attach_pd()
authorJoe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
Sat, 21 Dec 2024 07:57:12 +0000 (16:57 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 2 Jan 2025 09:34:14 +0000 (10:34 +0100)
commitf5d231592430abdae07dd422671b3514e10196f2
treef4646c2ce4f8a19581af45231d635ba51860d82a
parent4ecd6f505e4f23689701b4c2b72a1144cd9eee3c
dmaengine: fsl-edma: implement the cleanup path of fsl_edma3_attach_pd()

commit ccfa3131d4a0347988e73638edea5c8281b6d2c7 upstream.

Current implementation of fsl_edma3_attach_pd() does not provide a
cleanup path, resulting in a memory leak. For example,
dev_pm_domain_detach() is not called after dev_pm_domain_attach_by_id(),
and the device link created with the DL_FLAG_STATELESS is not released
explicitly.

Therefore, provide a cleanup function fsl_edma3_detach_pd() and call it
upon failure. Also add a devm_add_action_or_reset() call with this
function after a successful fsl_edma3_attach_pd().

Fixes: 72f5801a4e2b ("dmaengine: fsl-edma: integrate v3 support")
Signed-off-by: Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
Link: https://lore.kernel.org/r/20241221075712.3297200-1-joe@pf.is.s.u-tokyo.ac.jp
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/dma/fsl-edma-common.h
drivers/dma/fsl-edma-main.c