Commit 1cd425b6 authored by Dmitry Tarnyagin's avatar Dmitry Tarnyagin Committed by Ohad Ben-Cohen

remoteproc/ste: fix memory leak on shutdown

Fixes coherent memory leakage, caused by non-deallocated
firmware image chunk.

Signed-off-by: default avatarDmitry Tarnyagin <>
Signed-off-by: default avatarSjur Brændeland <>
Acked-by: default avatarIdo Yariv <>
[slightly edit subject and commit log]
Signed-off-by: default avatarOhad Ben-Cohen <>
parent b39599b7
......@@ -240,6 +240,8 @@ static int sproc_drv_remove(struct platform_device *pdev)
/* Unregister as remoteproc device */
dma_free_coherent(sproc->rproc->dev.parent, SPROC_FW_SIZE,
sproc->fw_addr, sproc->fw_dma_addr);
mdev->drv_data = NULL;
......@@ -297,10 +299,13 @@ static int sproc_probe(struct platform_device *pdev)
/* Register as a remoteproc device */
err = rproc_add(rproc);
if (err)
goto free_rproc;
goto free_mem;
return 0;
dma_free_coherent(rproc->dev.parent, SPROC_FW_SIZE,
sproc->fw_addr, sproc->fw_dma_addr);
/* Reset device data upon error */
mdev->drv_data = NULL;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment