]> www.infradead.org Git - users/hch/xfs.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)
committerVinod Koul <vkoul@kernel.org>
Tue, 24 Dec 2024 09:25:57 +0000 (14:55 +0530)
commitccfa3131d4a0347988e73638edea5c8281b6d2c7
tree9f214f00e0d45a21539b8d86f48bc765e945e803
parentdcbef0798eb825cd584f7a93f62bed63f7fbbfc9
dmaengine: fsl-edma: implement the cleanup path of fsl_edma3_attach_pd()

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>
drivers/dma/fsl-edma-common.h
drivers/dma/fsl-edma-main.c