提交 f42f79af 编写于 作者: S Suman Anna 提交者: Ohad Ben-Cohen

remoteproc: fix memory leak of remoteproc ida cache layers

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: NSuman Anna <s-anna@ti.com>
Signed-off-by: NOhad Ben-Cohen <ohad@wizery.com>
上级 92792e48
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册