]> git.baikalelectronics.ru Git - kernel.git/commit
remoteproc: fix memory leak of remoteproc ida cache layers
authorSuman Anna <s-anna@ti.com>
Thu, 17 Sep 2015 00:29:18 +0000 (19:29 -0500)
committerOhad Ben-Cohen <ohad@wizery.com>
Thu, 26 Nov 2015 15:44:28 +0000 (17:44 +0200)
commit78c7e8486095f7f34d554a1ccdd70f6cd8a4bdb8
tree90b9d5ff35c1fffee51c6ba2da09cf7517eba582
parent15ff2e9a1208723ab3b1ba4cb72c801259e2fe2d
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: Suman Anna <s-anna@ti.com>
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
drivers/remoteproc/remoteproc_core.c