From: Wendy Liang <[email protected]>

Release the declared DMA memory in the end of resource
cleanup.

Signed-off-by: Wendy Liang <[email protected]>
Signed-off-by: Michal Simek <[email protected]>
---
 drivers/remoteproc/remoteproc_core.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/remoteproc/remoteproc_core.c 
b/drivers/remoteproc/remoteproc_core.c
index 0ffd9dc..9d32737 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -882,6 +882,9 @@ static void rproc_resource_cleanup(struct rproc *rproc)
        /* clean up remote vdev entries */
        list_for_each_entry_safe(rvdev, rvtmp, &rproc->rvdevs, node)
                kref_put(&rvdev->refcount, rproc_vdev_release);
+
+       /* Release declared DMA memory */
+       dma_release_declared_memory(dev->parent);
 }
 
 /*
-- 
1.9.1

Reply via email to