author | Subhajit Paul <subhajit_paul@ti.com> | |
Fri, 21 Feb 2014 04:39:52 +0000 (10:09 +0530) | ||
committer | Suman Anna <s-anna@ti.com> | |
Fri, 21 Feb 2014 20:30:51 +0000 (14:30 -0600) | ||
commit | a4dbf5a189762fde99518340c3b06e6d2f6c8f35 | |
tree | 5252f7dfbe95258cad537e47b8f691943711b600 | tree | snapshot (tar.xz tar.gz zip) |
parent | 64c983cc1fdb8fad661ee7d5144e08691d4b26d9 | commit | diff |
rpmsg: rpc: cleanup the dma-buf idr completely at filp release
The idr library allocates certain number of cached idr_layers in
idr_pre_get() which are not freed during a regular idr_remove. A
complete cleanup of objects stored in an idr tree will require an
idr_remove_all() to remove all id mappings, and an idr_destroy()
to free all the cached idr_layers, in addition to the freeing of
all the objects using an idr_for_each() loop.
The current dma-buf idr cleanup has been cleaning up only the
regular objects, leading to a memory leak in the amount of the
cached idr_layers. Cleanup this dma-buf idr completely when
closing the file handle.
Signed-off-by: Subhajit Paul <subhajit_paul@ti.com>
[s-anna@ti.com: revise commit log]
Signed-off-by: Suman Anna <s-anna@ti.com>
The idr library allocates certain number of cached idr_layers in
idr_pre_get() which are not freed during a regular idr_remove. A
complete cleanup of objects stored in an idr tree will require an
idr_remove_all() to remove all id mappings, and an idr_destroy()
to free all the cached idr_layers, in addition to the freeing of
all the objects using an idr_for_each() loop.
The current dma-buf idr cleanup has been cleaning up only the
regular objects, leading to a memory leak in the amount of the
cached idr_layers. Cleanup this dma-buf idr completely when
closing the file handle.
Signed-off-by: Subhajit Paul <subhajit_paul@ti.com>
[s-anna@ti.com: revise commit log]
Signed-off-by: Suman Anna <s-anna@ti.com>
drivers/rpmsg/rpmsg_rpc.c | diff | blob | history |