aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorliuhailong <[email protected]>2021-06-18 17:50:35 +0800
committerGreg Kroah-Hartman <[email protected]>2021-06-18 13:02:40 +0200
commit594ea7358b051d4638fb587e0234a8a038f47e3d (patch)
tree4a3fda3fdc18a9a7eb38fd65c580c84b613c10b5
parent8c51c9b59a103fe7f4ab0c81ce9a202af7f1ece1 (diff)
staging: android: ashmem: add size field in procfs fdinfo
add this information to help user to find ashmem problem. ashmem leak scenario: -000|fd = ashmem_create_region -001|mmap and pagefault -002|munmap -003|forget close(fd) <---- which lead to ashmem leak Signed-off-by: liuhailong <[email protected]> 收件人: 刘海龙(DuckBuBee) <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
-rw-r--r--drivers/staging/android/ashmem.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/staging/android/ashmem.c b/drivers/staging/android/ashmem.c
index 8ee4320a5dc6..ddbde3f8430e 100644
--- a/drivers/staging/android/ashmem.c
+++ b/drivers/staging/android/ashmem.c
@@ -895,6 +895,8 @@ static void ashmem_show_fdinfo(struct seq_file *m, struct file *file)
seq_printf(m, "name:\t%s\n",
asma->name + ASHMEM_NAME_PREFIX_LEN);
+ seq_printf(m, "size:\t%zu\n", asma->size);
+
mutex_unlock(&ashmem_mutex);
}
#endif