aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSuman Anna <s-anna@ti.com>2015-09-16 19:29:18 -0500
committerOhad Ben-Cohen <ohad@wizery.com>2015-11-26 17:44:28 +0200
commitf42f79af16ce2e8fff49ea9ba4949d3abdd6f26f (patch)
tree90b9d5ff35c1fffee51c6ba2da09cf7517eba582
parent92792e48e2ae6051af30468a87994b5432da2f06 (diff)
downloadremoteproc-fixes.tar.gz
remoteproc: fix memory leak of remoteproc ida cache layersremoteproc-4.4-fixesfixes
The remoteproc core uses a static ida named rproc_dev_index for assigning an automatic index number to a registered remoteproc. The ida core may allocate some internal idr cache layers and ida bitmap upon any ida allocation, and all these layers are truely freed only upon the ida destruction. The rproc_dev_index ida is not destroyed at present, leading to a memory leak when using the remoteproc core as a module and atleast one rproc device is registered and unregistered. Fix this by invoking ida_destroy() in the remoteproc core module exit. Signed-off-by: Suman Anna <s-anna@ti.com> Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
-rw-r--r--drivers/remoteproc/remoteproc_core.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index 8b3130f22b42b3..9e03d158f41191 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -1478,6 +1478,8 @@ module_init(remoteproc_init);
static void __exit remoteproc_exit(void)
{
+ ida_destroy(&rproc_dev_index);
+
rproc_exit_debugfs();
}
module_exit(remoteproc_exit);