[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20130410224342.073305659@linuxfoundation.org>
Date: Wed, 10 Apr 2013 15:46:35 -0700
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org,
Dmitry Tarnyagin <dmitry.tarnyagin@...ricsson.com>,
Sjur Brændeland <sjur.brandeland@...ricsson.com>,
Ido Yariv <ido@...ery.com>, Ohad Ben-Cohen <ohad@...ery.com>
Subject: [ 38/64] remoteproc/ste: fix memory leak on shutdown
3.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Tarnyagin <dmitry.tarnyagin@...ricsson.com>
commit 1cd425b660bd5b4f41b9175b0b7bf3828ce88144 upstream.
Fixes coherent memory leakage, caused by non-deallocated
firmware image chunk.
Signed-off-by: Dmitry Tarnyagin <dmitry.tarnyagin@...ricsson.com>
Signed-off-by: Sjur Brændeland <sjur.brandeland@...ricsson.com>
Acked-by: Ido Yariv <ido@...ery.com>
[slightly edit subject and commit log]
Signed-off-by: Ohad Ben-Cohen <ohad@...ery.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
drivers/remoteproc/ste_modem_rproc.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
--- a/drivers/remoteproc/ste_modem_rproc.c
+++ b/drivers/remoteproc/ste_modem_rproc.c
@@ -240,6 +240,8 @@ static int sproc_drv_remove(struct platf
/* Unregister as remoteproc device */
rproc_del(sproc->rproc);
+ dma_free_coherent(sproc->rproc->dev.parent, SPROC_FW_SIZE,
+ sproc->fw_addr, sproc->fw_dma_addr);
rproc_put(sproc->rproc);
mdev->drv_data = NULL;
@@ -297,10 +299,13 @@ static int sproc_probe(struct platform_d
/* Register as a remoteproc device */
err = rproc_add(rproc);
if (err)
- goto free_rproc;
+ goto free_mem;
return 0;
+free_mem:
+ dma_free_coherent(rproc->dev.parent, SPROC_FW_SIZE,
+ sproc->fw_addr, sproc->fw_dma_addr);
free_rproc:
/* Reset device data upon error */
mdev->drv_data = NULL;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists