Skip to content

Commit f42f79a

Browse files
sumanannaohadbc
authored andcommitted
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 <[email protected]> Signed-off-by: Ohad Ben-Cohen <[email protected]>
1 parent 92792e4 commit f42f79a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/remoteproc/remoteproc_core.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1478,6 +1478,8 @@ module_init(remoteproc_init);
14781478

14791479
static void __exit remoteproc_exit(void)
14801480
{
1481+
ida_destroy(&rproc_dev_index);
1482+
14811483
rproc_exit_debugfs();
14821484
}
14831485
module_exit(remoteproc_exit);

0 commit comments

Comments
 (0)